ArchHooks modified for Unix

This commit is contained in:
Prcuvu
2020-02-08 16:08:02 +08:00
parent de4dc62846
commit d893c84b7b
+16
View File
@@ -182,10 +182,26 @@ RString ArchHooks::GetPreferredLanguage()
if (getenv("LANG")) if (getenv("LANG"))
{ {
locale = getenv("LANG"); locale = getenv("LANG");
RString region = locale.substr(3, 2);
locale = locale.substr(0, 2); locale = locale.substr(0, 2);
if (locale == "zh")
{
if (region == "CN" || region == "SG")
{
locale = "zh-Hans";
}
else if (region == "HK" || region == "TW")
{
locale = "zh-Hant";
}
}
} }
else else
{
LOG->Warn("Unable to determine system language. Using English.");
locale = "en"; locale = "en";
}
return locale; return locale;
} }