Fix passing of default language to wxTranslations

wxTranslations needs the information that user's default language is
used; in particular, it may choose to use a cascade of user-preferred
languages to choose the best UI language.

This was accidentally broken by
18bf718f60 which changed the logic to
fill shortName from the builtin database. This consequently changed
wxTranslations to use only the single detected language and ignore
user's preference cascade.

Closes https://github.com/wxWidgets/wxWidgets/pull/2385
This commit is contained in:
Václav Slavík 2021-05-30 17:03:31 +02:00 committed by Vadim Zeitlin
parent e050c2a1b7
commit 3417c8e48b

View File

@ -615,7 +615,9 @@ bool wxLocale::Init(int lang, int flags)
(
retloc != NULL,
name,
shortName,
// wxLANGUAGE_DEFAULT needs to be passed to wxTranslations as ""
// for correct detection of user's preferred language(s)
lang == wxLANGUAGE_DEFAULT ? wxString() : shortName,
flags & wxLOCALE_LOAD_DEFAULT
);
#else // !(__UNIX__ || __WIN32__)