i18n: Less naïve approach at identifying language codes
This solves an issue I pointed out in PR #4705 where language codes longer than 2 characters would get misidentified during the conversion to Windows locale names.
This commit is contained in:
parent
48e6b821b0
commit
df3b0222a8
1 changed files with 2 additions and 2 deletions
|
@ -216,8 +216,8 @@ static void wesnoth_setlocale(int category, const std::string& slocale,
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
std::string win_locale(locale, 0, 2);
|
||||
locale = posix_locale_to_win32(win_locale);
|
||||
std::string lang_code{locale, 0, locale.find_first_of("_@.")};
|
||||
locale = posix_locale_to_win32(lang_code);
|
||||
#endif
|
||||
|
||||
char *res = nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue