Changeset - r25136:f1bcccbb2c39
[Not reviewed]
master
0 1 0
Wim Leflere - 3 years ago 2021-04-09 09:22:03
wim.leflere@gmail.com
Change: [win32] Use user UI language for initial language selection (#8973) (#8974)
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/os/windows/win32.cpp
Show inline comments
 
@@ -629,9 +629,12 @@ wchar_t *convert_to_fs(const char *name,
 
/** Determine the current user's locale. */
 
const char *GetCurrentLocale(const char *)
 
{
 
	const LANGID userUiLang = GetUserDefaultUILanguage();
 
	const LCID userUiLocale = MAKELCID(userUiLang, SORT_DEFAULT);
 

	
 
	char lang[9], country[9];
 
	if (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, lang, lengthof(lang)) == 0 ||
 
	    GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, country, lengthof(country)) == 0) {
 
	if (GetLocaleInfoA(userUiLocale, LOCALE_SISO639LANGNAME, lang, lengthof(lang)) == 0 ||
 
	    GetLocaleInfoA(userUiLocale, LOCALE_SISO3166CTRYNAME, country, lengthof(country)) == 0) {
 
		/* Unable to retrieve the locale. */
 
		return nullptr;
 
	}
0 comments (0 inline, 0 general)