Fixed: With new iOS versions (and perhaps OS X), locale can contains country code
This commit is contained in:
parent
953759f9b1
commit
f98786bc62
1 changed files with 13 additions and 4 deletions
|
@ -306,13 +306,22 @@ std::string CI18N::getSystemLanguageCode ()
|
|||
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
|
||||
if (!lang.empty() && isLanguageCodeSupported(lang))
|
||||
if (isLanguageCodeSupported(lang))
|
||||
{
|
||||
s_cachedSystemLanguage = lang;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// don't need languages array anymore
|
||||
CFRelease(langs);
|
||||
|
|
Loading…
Reference in a new issue