Override GetPreferredUILanguages with WXLANGUAGE

Add support for overriding GetPreferredUILanguages() return value by
setting the WXLANGUAGE environment variable to a colon-separated list
of desired languages (same as GNU's LANGUAGE variable).

Primarily used for unit tests, but may be more generally useful.
This commit is contained in:
Václav Slavík 2024-02-13 13:38:37 +01:00
parent f248f0593c
commit 1f658ff729
2 changed files with 35 additions and 1 deletions

View file

@ -51,6 +51,12 @@ wxWidgets programs.
default value if it's not a number, so that e.g. setting it to "yes"
suppresses all GTK diagnostics while setting it to 16 only suppresses
GTK warning messages.}
@itemdef{WXLANGUAGE,
This variable can be set to override OS setting of preferred languages
and make wxUILocale::GetPreferredUILanguages() return the set list
instead. The format is same as GNU's <a
href="https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html">LANGUAGE</a>
variable: a colon-separated list of language codes.}
*/
@see wxSystemOptions