MultiLangMgr::getOSUserLanguage (): get rid of special windows code

This commit is contained in:
heckflosse 2018-12-02 21:07:54 +01:00
parent 61c84b9ee7
commit 562ed3b22a

View File

@ -209,27 +209,6 @@ Glib::ustring MultiLangMgr::getOSUserLanguage ()
{ {
Glib::ustring langName ("default"); Glib::ustring langName ("default");
#if defined (WIN32)
const LCID localeID = GetUserDefaultLCID ();
TCHAR localeName[18];
const int langLen = GetLocaleInfo (localeID, LOCALE_SISO639LANGNAME, localeName, 9);
if (langLen <= 0) {
return langName;
}
localeName[langLen - 1] = '-';
const int countryLen = GetLocaleInfo (localeID, LOCALE_SISO3166CTRYNAME, &localeName[langLen], 9);
if (countryLen <= 0) {
return langName;
}
langName = localeToLang (localeName);
#elif defined (__linux__) || defined (__APPLE__)
// Query the current locale and force decimal point to dot. // Query the current locale and force decimal point to dot.
const char *locale = getenv("LANG"); const char *locale = getenv("LANG");
if (locale || (locale = setlocale (LC_CTYPE, ""))) { if (locale || (locale = setlocale (LC_CTYPE, ""))) {
@ -238,7 +217,5 @@ Glib::ustring MultiLangMgr::getOSUserLanguage ()
setlocale (LC_NUMERIC, "C"); setlocale (LC_NUMERIC, "C");
#endif
return langName; return langName;
} }