Move platform-specific parts of wxLocale::Init() to wxUILocale

This is tidier than using #ifdefs in the same common file and also
ensures that initializing wxLocale affects wxUILocale too, which will be
important for compatibility when the code elsewhere is modified to use
wxUILocale::GetInfo() instead of wxLocale::GetInfo() in the upcoming
commits.

This commit is best viewed with --color-moved git option.
This commit is contained in:
Vadim Zeitlin
2021-08-14 17:42:29 +01:00
parent d3a1abaab2
commit 37a23e1ab1
9 changed files with 270 additions and 193 deletions

View File

@@ -33,6 +33,15 @@ public:
// It may return NULL in case of failure.
static wxUILocaleImpl* CreateUserDefault();
// This function exists only for wxLocale compatibility and sets the locale
// corresponding to the given language.
//
// The language passed to this function is a valid language, i.e. neither
// wxLANGUAGE_UNKNOWN nor wxLANGUAGE_DEFAULT.
//
// It may return NULL in case of failure.
static wxUILocaleImpl* CreateForLanguage(const wxLanguageInfo& info);
// Functions corresponding to wxUILocale ones.
virtual wxString GetName() const = 0;
virtual wxString GetInfo(wxLocaleInfo index, wxLocaleCategory cat) const = 0;