Separate creating wxUILocaleImpl from using it
Add Use() virtual function which can be used if the newly created wxUILocaleImpl object should be used as the default UI locale. Currently Use() is always called after creating a new wxUILocaleImpl, so adding a separate function just seems to complicate matters needlessly, but this won't be the case any more soon, when wxUILocaleImpl could be created for using them for other purposes than making them the default. No real changes yet.
This commit is contained in:
@@ -33,8 +33,8 @@ 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.
|
||||
// This function exists only for wxLocale compatibility and creates 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.
|
||||
@@ -42,6 +42,13 @@ public:
|
||||
// It may return NULL in case of failure.
|
||||
static wxUILocaleImpl* CreateForLanguage(const wxLanguageInfo& info);
|
||||
|
||||
// Use this locale in the UI.
|
||||
//
|
||||
// This is not implemented for all platforms, notably not for Mac where the
|
||||
// UI locale is determined at application startup, and so this function
|
||||
// always returns false there.
|
||||
virtual bool Use() = 0;
|
||||
|
||||
// Functions corresponding to wxUILocale ones.
|
||||
virtual wxString GetName() const = 0;
|
||||
virtual wxString GetInfo(wxLocaleInfo index, wxLocaleCategory cat) const = 0;
|
||||
|
Reference in New Issue
Block a user