Explicitly disallow wxLANGUAGE_UNKNOWN in wxLocale::Init()

This value doesn't make here, so be upfront about it.
This commit is contained in:
Vadim Zeitlin
2021-02-28 20:04:33 +01:00
parent 18bf718f60
commit 91ec900034
2 changed files with 9 additions and 3 deletions

View File

@@ -434,6 +434,10 @@ bool wxLocale::Init(int lang, int flags)
wxS("wxLOCALE_CONV_ENCODING is no longer supported, add charset to your catalogs") );
#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;
const wxLanguageInfo *info = GetLanguageInfo(lang);