From dc1710bbf33fd660887e79ad585290ea8a2311a3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 6 Jan 2023 03:45:47 +0100 Subject: [PATCH] Recommend using wxUILocale::GetSystemLanguage() in wxLocale docs The wxUILocale function really returns the default language unlike the one in wxLocale which must kepe using the default locale for compatibility, making its name confusing. (cherry picked from commit ce04dbc0247aa548680f753568f9c9c39a4236b9) --- interface/wx/intl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/interface/wx/intl.h b/interface/wx/intl.h index 050e730ce3..3d082f3ce1 100644 --- a/interface/wx/intl.h +++ b/interface/wx/intl.h @@ -526,13 +526,15 @@ public: /** Tries to detect the user's default locale setting. - Returns the ::wxLanguage value or @c wxLANGUAGE_UNKNOWN if the language-guessing - algorithm failed. + @note This function is somewhat misleading, as it uses the default + system locale to determine its return value, and not just the system + language. It is preserved for backwards compatibility, but to actually + get the language, and not locale, used by the system by default, call + wxUILocale::GetSystemLanguage() instead. - @note This function works with @em locales and returns the user's default - locale. This may be, and usually is, the same as their preferred UI - language, but it's not the same thing. Use wxTranslation to obtain - @em language information. + Returns the ::wxLanguage value or @c wxLANGUAGE_UNKNOWN if the locale + is not recognized, as can notably happen when combining any language + with a region where this language is not typically spoken. @see wxTranslations::GetBestTranslation(). */