mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-20 05:01:51 -04:00
UI: Fix GetPreferredLocales locale detection
When scanning the preferred locales, always pick the one with exact match before falling back to other matches.
This commit is contained in:
1 parent
05c9ddd229
commit
33dd7eebd2
1 file changed
+3
-2
+3
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user