// --- --- --- generated code begins here --- --- ---
-// This enum is generated by misc/languages/genlang.py
-// When making changes, please put them into misc/languages/langtabl.txt
+/**
+ The languages supported by wxLocale.
+
+ This enum is generated by misc/languages/genlang.py
+ When making changes, please put them into misc/languages/langtabl.txt
+*/
enum wxLanguage
{
- // user's default/preffered language as got from OS:
+ /// User's default/preffered language as got from OS.
wxLANGUAGE_DEFAULT,
- // unknown language, if wxLocale::GetSystemLanguage fails:
+
+ /// Unknown language, returned if wxLocale::GetSystemLanguage fails.
wxLANGUAGE_UNKNOWN,
wxLANGUAGE_ABKHAZIAN,
wxLANGUAGE_ARABIC_YEMEN,
wxLANGUAGE_ARMENIAN,
wxLANGUAGE_ASSAMESE,
+ wxLANGUAGE_ASTURIAN,
wxLANGUAGE_AYMARA,
wxLANGUAGE_AZERI,
wxLANGUAGE_AZERI_CYRILLIC,
wxLANGUAGE_ZHUANG,
wxLANGUAGE_ZULU,
- // for custom, user-defined languages:
+ /// For custom, user-defined languages.
wxLANGUAGE_USER_DEFINED
};
// monetary value
wxLOCALE_CAT_MONEY,
+ // default category for wxLocaleInfo values which only apply to a single
+ // category (e.g. wxLOCALE_SHORT_DATE_FMT)
+ wxLOCALE_CAT_DEFAULT,
+
wxLOCALE_CAT_MAX
};
enum wxLocaleInfo
{
- // the thounsands separator
+ // the thousands separator (for wxLOCALE_CAT_NUMBER or MONEY)
wxLOCALE_THOUSANDS_SEP,
- // the character used as decimal point
- wxLOCALE_DECIMAL_POINT
+ // the character used as decimal point (for wxLOCALE_CAT_NUMBER or MONEY)
+ wxLOCALE_DECIMAL_POINT,
+
+ // the stftime()-formats used for short/long date and time representations
+ // (under some platforms short and long date formats are the same)
+ //
+ // NB: these elements should appear in this order, code in GetInfo() relies
+ // on it
+ wxLOCALE_SHORT_DATE_FMT,
+ wxLOCALE_LONG_DATE_FMT,
+ wxLOCALE_DATE_TIME_FMT,
+ wxLOCALE_TIME_FMT
};
enum wxLocaleInitFlags
{
- wxLOCALE_LOAD_DEFAULT = 0x0001, // load wxwin.mo?
- wxLOCALE_CONV_ENCODING = 0x0002 // convert encoding on the fly?
+ wxLOCALE_DONT_LOAD_DEFAULT = 0x0000, // don't load wxwin.mo
+ wxLOCALE_LOAD_DEFAULT = 0x0001 // load wxwin.mo?
+#if WXWIN_COMPATIBILITY_2_8
+ ,wxLOCALE_CONV_ENCODING = 0x0002 // no longer used, simply remove
+ // it from the existing code
+#endif
};
class WXDLLIMPEXP_BASE wxLocale
wxLocale(const wxString& name, // name (for messages)
const wxString& shortName = wxEmptyString, // dir prefix (for msg files)
const wxString& locale = wxEmptyString, // locale (for setlocale)
- bool bLoadDefault = true, // preload wxstd.mo?
- bool bConvertEncoding = false) // convert Win<->Unix if necessary?
+ bool bLoadDefault = true // preload wxstd.mo?
+#if WXWIN_COMPATIBILITY_2_8
+ ,bool bConvertEncoding = true // convert Win<->Unix if necessary?
+#endif
+ )
{
DoCommonInit();
+#if WXWIN_COMPATIBILITY_2_8
Init(name, shortName, locale, bLoadDefault, bConvertEncoding);
+#else
+ Init(name, shortName, locale, bLoadDefault);
+#endif
}
wxLocale(int language, // wxLanguage id or custom language
- int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING)
+ int flags = wxLOCALE_LOAD_DEFAULT)
{
DoCommonInit();
bool Init(const wxString& name,
const wxString& shortName = wxEmptyString,
const wxString& locale = wxEmptyString,
- bool bLoadDefault = true,
- bool bConvertEncoding = false);
+ bool bLoadDefault = true
+#if WXWIN_COMPATIBILITY_2_8
+ ,bool bConvertEncoding = true
+#endif
+ );
// same as second ctor (returns true on success)
bool Init(int language = wxLANGUAGE_DEFAULT,
- int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
+ int flags = wxLOCALE_LOAD_DEFAULT);
// restores old locale
virtual ~wxLocale();
// get the values of the given locale-dependent datum: the current locale
// is used, the US default value is returned if everything else fails
- static wxString GetInfo(wxLocaleInfo index, wxLocaleCategory cat);
+ static wxString GetInfo(wxLocaleInfo index,
+ wxLocaleCategory cat = wxLOCALE_CAT_DEFAULT);
// return true if the locale was set successfully
bool IsOk() const { return m_pszOldLocale != NULL; }
wxMsgCatalog *m_pMsgCat; // pointer to linked list of catalogs
- bool m_bConvertEncoding;
-
bool m_initialized;
static wxLanguageInfoArray *ms_languagesDB;