Recognize "ll_LL" as at language "ll" in GetSystemLanguage()

If we can't find an exact match for the system locale in the database,
try to at least find the corresponding language.

This is almost certainly what the intention of the original code was, as
otherwise the entire loop was useless because it couldn't find anything
that wouldn't have been found in the loop just above.

This allows to correctly load German translations when using unsupported
locale such as "de_IT", for example.

See #19082.
This commit is contained in:
Vadim Zeitlin
2021-02-28 23:39:20 +01:00
parent 73b41dda91
commit d03f193719

View File

@@ -732,7 +732,7 @@ inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value)
{ {
for ( i = 0; i < count; i++ ) for ( i = 0; i < count; i++ )
{ {
if ( ms_languagesDB->Item(i).CanonicalName == lang ) if ( ExtractLang(ms_languagesDB->Item(i).CanonicalName) == lang )
{ {
break; break;
} }