From d03f1937192ed20aee39a4b9a475849e3dab1a92 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Feb 2021 23:39:20 +0100 Subject: [PATCH] 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. --- src/common/intl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index c376c1dcaa..9598f0ec12 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -732,7 +732,7 @@ inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value) { for ( i = 0; i < count; i++ ) { - if ( ms_languagesDB->Item(i).CanonicalName == lang ) + if ( ExtractLang(ms_languagesDB->Item(i).CanonicalName) == lang ) { break; }