Merge pull request #3038 from khng300/platform-x11-locale-detect-fixes

UI: Fix GetPreferredLocales locale detection
This commit is contained in:
Jim 2020-06-21 06:10:40 -07:00 committed by GitHub
commit ef6f94e172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,7 @@ string GetDefaultVideoSavePath()
vector<string> GetPreferredLocales()
{
setlocale(LC_ALL, "");
vector<string> matched;
string messages = setlocale(LC_MESSAGES, NULL);
if (!messages.size() || messages == "C" || messages == "POSIX")
return {};
@ -85,10 +86,10 @@ vector<string> GetPreferredLocales()
return {locale};
if (locale.substr(0, 2) == messages.substr(0, 2))
return {locale};
matched.push_back(locale);
}
return {};
return matched;
}
bool IsAlwaysOnTop(QWidget *window)