File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,15 @@ namespace Rtt
272
272
// read build.settings
273
273
if (fProjectSettings ->HasBuildSettings ())
274
274
{
275
- wxString localeName = wxLocale::GetLanguageInfo (wxLocale::GetSystemLanguage ())->CanonicalName .Lower ();
275
+ int systemLanguage = wxLocale::GetSystemLanguage ();
276
+
277
+ // fallback to en_us if wx wasn't able to determine the system language
278
+ if (systemLanguage == wxLANGUAGE_UNKNOWN)
279
+ {
280
+ systemLanguage = wxLANGUAGE_ENGLISH_US;
281
+ }
282
+
283
+ wxString localeName = wxLocale::GetLanguageInfo (systemLanguage)->CanonicalName .Lower ();
276
284
string langCode = localeName.ToStdString ().substr (0 , 2 );
277
285
string countryCode = localeName.ToStdString ().substr (3 , 5 );
278
286
int minWidth = fProjectSettings ->GetMinWindowViewWidth ();
Original file line number Diff line number Diff line change @@ -574,7 +574,15 @@ namespace Rtt
574
574
575
575
// Fetch the requested preference value.
576
576
const char *resultPointer = " " ;
577
- wxString localeName = wxLocale::GetLanguageInfo (wxLocale::GetSystemLanguage ())->CanonicalName .Lower ();
577
+ int systemLanguage = wxLocale::GetSystemLanguage ();
578
+
579
+ // fallback to en_us if wx wasn't able to determine the system language
580
+ if (systemLanguage == wxLANGUAGE_UNKNOWN)
581
+ {
582
+ systemLanguage = wxLANGUAGE_ENGLISH_US;
583
+ }
584
+
585
+ wxString localeName = wxLocale::GetLanguageInfo (systemLanguage)->CanonicalName .Lower ();
578
586
579
587
switch (category)
580
588
{
Original file line number Diff line number Diff line change 1497
1497
<Preprocessor Value =" wxUSE_UNSAFE_WXSTRING_CONV" />
1498
1498
<Preprocessor Value =" wxUSE_STD_CONTAINERS_COMPATIBLY" />
1499
1499
<Preprocessor Value =" wxUSE_GLCANVAS" />
1500
- <Preprocessor Value =" _DEBUG" />
1501
1500
<Preprocessor Value =" Rtt_LINUX_ENV" />
1502
1501
<Preprocessor Value =" FT2_BUILD_LIBRARY" />
1503
1502
<Preprocessor Value =" ALMIXER_COMPILE_WITHOUT_SDL" />
You can’t perform that action at this time.
0 commit comments