Fix compatibility with wxWidgets 3.0.x

- Use CanonicalName when GetCanonicalWithRegion() isn't available
This commit is contained in:
Salvador E. Tropea 2023-02-22 11:15:12 -03:00 committed by jean-pierre charras
parent 1b07e81936
commit b21e65fc5f
2 changed files with 5 additions and 1 deletions

View File

@ -19,12 +19,12 @@
*/ */
#include <font/fontconfig.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <wx/log.h> #include <wx/log.h>
#include <trace_helpers.h> #include <trace_helpers.h>
#include <string_utils.h> #include <string_utils.h>
#include <macros.h> #include <macros.h>
#include <font/fontconfig.h>
using namespace fontconfig; using namespace fontconfig;

View File

@ -783,7 +783,11 @@ wxString PGM_BASE::GetLanguageTag()
return ""; return "";
else else
{ {
#if wxCHECK_VERSION( 3, 1, 6 )
wxString str = langInfo->GetCanonicalWithRegion(); wxString str = langInfo->GetCanonicalWithRegion();
#else
wxString str = langInfo->CanonicalName;
#endif
str.Replace( "_", "-" ); str.Replace( "_", "-" );
return str; return str;