Fix of #8299 (Linux crash when selecting locales)
This commit is contained in:
parent
7fbaf0f96c
commit
c99de065f7
1 changed files with 11 additions and 9 deletions
|
@ -1962,6 +1962,7 @@ static const wxLanguageInfo* linux_get_existing_locale_language(const wxLanguage
|
||||||
}),
|
}),
|
||||||
locales.end());
|
locales.end());
|
||||||
|
|
||||||
|
if (system_language) {
|
||||||
// Is there a candidate matching a country code of a system language? Move it to the end,
|
// Is there a candidate matching a country code of a system language? Move it to the end,
|
||||||
// while maintaining the order of matches, so that the best match ends up at the very end.
|
// while maintaining the order of matches, so that the best match ends up at the very end.
|
||||||
std::string system_country = "_" + into_u8(system_language->CanonicalName.AfterFirst('_')).substr(0, 2);
|
std::string system_country = "_" + into_u8(system_language->CanonicalName.AfterFirst('_')).substr(0, 2);
|
||||||
|
@ -1971,6 +1972,7 @@ static const wxLanguageInfo* linux_get_existing_locale_language(const wxLanguage
|
||||||
locales.emplace_back(std::move(locales[i]));
|
locales.emplace_back(std::move(locales[i]));
|
||||||
locales[i].clear();
|
locales[i].clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now try them one by one.
|
// Now try them one by one.
|
||||||
for (auto it = locales.rbegin(); it != locales.rend(); ++ it)
|
for (auto it = locales.rbegin(); it != locales.rend(); ++ it)
|
||||||
|
|
Loading…
Add table
Reference in a new issue