From 5150c1a1bdfbaa47ab1a9f1a25074dc2094bb024 Mon Sep 17 00:00:00 2001 From: Brian Nixon Date: Tue, 4 Apr 2023 17:15:21 +0200 Subject: [PATCH] Fix wxUILocale::GetPreferredUILanguages() under Windows < 10 Return the default locale name under old Windows versions instead of always returning an empty vector and logging a spurious error. See #23416. (cherry picked from commit a242283456ffd0920a2384f6fee45d56a7ecc3a5) --- docs/changes.txt | 1 + src/msw/uilocale.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index b005da1176..41eb6b6e58 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -254,6 +254,7 @@ wxMSW: - Fix setting locale for wxLANGUAGE_UKRAINIAN (Ulrich Telle, #23210). - Don't reset custom wxToolBar background on system colour change (#23386). +- Fix wxUILocale::GetPreferredUILanguages() under < 10 (Brian Nixon, #23416). wxOSX: diff --git a/src/msw/uilocale.cpp b/src/msw/uilocale.cpp index 15ee328e47..55ec448339 100644 --- a/src/msw/uilocale.cpp +++ b/src/msw/uilocale.cpp @@ -456,7 +456,7 @@ public: { // Use the default user locale for Windows 7 resp Windows 8.x and below wchar_t buf[LOCALE_NAME_MAX_LENGTH]; - if (!ms_GetUserDefaultLocaleName(buf, LOCALE_NAME_MAX_LENGTH)) + if (ms_GetUserDefaultLocaleName(buf, LOCALE_NAME_MAX_LENGTH)) { preferred.push_back(buf); }