mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Fixed: With new iOS versions (and perhaps OS X), locale can contains country code
--HG-- branch : develop
This commit is contained in:
parent
41176a7d02
commit
faae2973ac
1 changed files with 13 additions and 4 deletions
|
@ -306,11 +306,20 @@ std::string CI18N::getSystemLanguageCode ()
|
||||||
CFRelease(langCF);
|
CFRelease(langCF);
|
||||||
}
|
}
|
||||||
|
|
||||||
// only keep language code if supported by NeL
|
if (!lang.empty())
|
||||||
if (!lang.empty() && isLanguageCodeSupported(lang))
|
|
||||||
{
|
{
|
||||||
s_cachedSystemLanguage = lang;
|
// fix language code if country is specified
|
||||||
break;
|
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 (isLanguageCodeSupported(lang))
|
||||||
|
{
|
||||||
|
s_cachedSystemLanguage = lang;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue