Explicitly disallow wxLANGUAGE_UNKNOWN in wxLocale::Init()
This value doesn't make here, so be upfront about it.
This commit is contained in:
@@ -459,9 +459,11 @@ public:
|
|||||||
try to translate the messages using the message catalogs for this locale.
|
try to translate the messages using the message catalogs for this locale.
|
||||||
|
|
||||||
@param language
|
@param language
|
||||||
::wxLanguage identifier of the locale.
|
::wxLanguage identifier of the locale. It can be either some
|
||||||
@c wxLANGUAGE_DEFAULT has special meaning -- wxLocale will use system's
|
concrete language, e.g. @c wxLANGUAGE_ESPERANTO, or a special value
|
||||||
default language (see GetSystemLanguage()).
|
@c wxLANGUAGE_DEFAULT which means that wxLocale should use system's
|
||||||
|
default language (see GetSystemLanguage()). Notice that the value
|
||||||
|
@c wxLANGUAGE_UNKNOWN is not allowed here.
|
||||||
@param flags
|
@param flags
|
||||||
Combination of the following:
|
Combination of the following:
|
||||||
- wxLOCALE_LOAD_DEFAULT: Load the message catalog for the given locale
|
- wxLOCALE_LOAD_DEFAULT: Load the message catalog for the given locale
|
||||||
|
@@ -434,6 +434,10 @@ bool wxLocale::Init(int lang, int flags)
|
|||||||
wxS("wxLOCALE_CONV_ENCODING is no longer supported, add charset to your catalogs") );
|
wxS("wxLOCALE_CONV_ENCODING is no longer supported, add charset to your catalogs") );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxCHECK_MSG( lang != wxLANGUAGE_UNKNOWN, false,
|
||||||
|
wxS("Initializing unknown locale doesn't make sense, did you ")
|
||||||
|
wxS("mean to use wxLANGUAGE_DEFAULT perhaps?") );
|
||||||
|
|
||||||
wxString name, shortName;
|
wxString name, shortName;
|
||||||
|
|
||||||
const wxLanguageInfo *info = GetLanguageInfo(lang);
|
const wxLanguageInfo *info = GetLanguageInfo(lang);
|
||||||
|
Reference in New Issue
Block a user