Ticket #15006 (portneeded defect: port to stable)
wxLocale::GetSystemLanguage() should ignore empty LANG_*/LC_* variables
| Reported by: | pm_kan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | base | Version: | 2.8.12 |
| Keywords: | Cc: | ||
| Blocked By: | Patch: | yes | |
| Blocking: |
Description
In *NIX builds current version of wxLocale::GetSystemLanguage() returns wxLANGUAGE_UNKNOWN if LC_ALL is set but empty, ignoring non-empty LC_MESSAGES/LANG variables.
It's standard way to ignore empty (null) environment variables in that case. For example, man 7 locale says:
If the second argument to setlocale(3) is empty string, "", for
the default locale, it is determined using the following steps:
1. If there is a non-null environment variable LC_ALL, the
value of LC_ALL is used.
2. If an environment variable with the same name as one of
the categories above exists and is non-null, its value is
used for that category.
3. If there is a non-null environment variable LANG, the
value of LANG is used.
Steps to reproduce:
set environment variables to
LC_ALL=
LANG=ru_RU.UTF-8
GetSystemLanguage() will return wxLANGUAGE_UNKNOWN instead of wxLANGUAGE_RUSSIAN.

