|
|
@ -306,13 +306,22 @@ std::string CI18N::getSystemLanguageCode ()
|
|
|
|
CFRelease(langCF);
|
|
|
|
CFRelease(langCF);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!lang.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// fix language code if country is specified
|
|
|
|
|
|
|
|
std::string::size_type pos = lang.find('-');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pos != std::string::npos)
|
|
|
|
|
|
|
|
lang = lang.substr(0, pos);
|
|
|
|
|
|
|
|
|
|
|
|
// only keep language code if supported by NeL
|
|
|
|
// only keep language code if supported by NeL
|
|
|
|
if (!lang.empty() && isLanguageCodeSupported(lang))
|
|
|
|
if (isLanguageCodeSupported(lang))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
s_cachedSystemLanguage = lang;
|
|
|
|
s_cachedSystemLanguage = lang;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// don't need languages array anymore
|
|
|
|
// don't need languages array anymore
|
|
|
|
CFRelease(langs);
|
|
|
|
CFRelease(langs);
|
|
|
|