use the LANG env var (if set) to determine the system language on Linux/Mac

Candidate fix for #3864
This commit is contained in:
Alberto Griggio 2017-05-06 21:21:07 +02:00
parent 14e3f0e88d
commit 9a47164c46

View File

@ -196,7 +196,8 @@ Glib::ustring MultiLangMgr::getOSUserLanguage ()
#elif defined (__linux__) || defined (__APPLE__)
// Query the current locale and force decimal point to dot.
if (const char* locale = setlocale (LC_CTYPE, "")) {
const char *locale = getenv("LANG");
if (locale || (locale = setlocale (LC_CTYPE, ""))) {
langName = localeToLang (locale);
}