Leave NULL impl pointer in wxUILocale if locale is not supported

This finally seems better than always creating some kind of impl object,
even if the locale isn't supported at all and makes all ports behave
consistently, as previously CreateForLocale() only returned NULL in
wxOSX implementation if the locale was unrecognized, but now all ports
do this (at least when locale_t and related functions are available
under Unix).

Also stop returning bool from Use(), as this resulted in initializing
wxLocale with any non-default language to fail under Mac: just ignore
the error here, as we always did it until now, because there is nothing
we can do about it anyhow.
This commit is contained in:
Vadim Zeitlin
2021-08-30 20:55:51 +02:00
parent e3ff6dc056
commit aa4cce8f7d
6 changed files with 133 additions and 91 deletions

View File

@@ -65,7 +65,7 @@ public:
private:
// Default ctor is private and exists only for implementation reasons,
// wxUILocale objects can't be invalid.
// creating invalid wxUILocale objects doesn't make much sense.
wxUILocale() : m_impl(NULL) { }
// Used by UseDefault().