X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/51c0d02b654665b4b09bb8b74df6607b05ce4ce2..6bd1764f2716e8d0814edd6374b20960bba23579:/interface/wx/intl.h diff --git a/interface/wx/intl.h b/interface/wx/intl.h index c655db5e04..947d47ad7e 100644 --- a/interface/wx/intl.h +++ b/interface/wx/intl.h @@ -17,7 +17,7 @@ */ enum wxLanguage { - /// User's default/preferred language as got from OS. + /// User's default/preffered language as got from OS. wxLANGUAGE_DEFAULT, /// Unknown language, returned if wxLocale::GetSystemLanguage fails. @@ -48,6 +48,7 @@ enum wxLanguage wxLANGUAGE_ARABIC_YEMEN, wxLANGUAGE_ARMENIAN, wxLANGUAGE_ASSAMESE, + wxLANGUAGE_ASTURIAN, wxLANGUAGE_AYMARA, wxLANGUAGE_AZERI, wxLANGUAGE_AZERI_CYRILLIC, @@ -275,32 +276,138 @@ enum wxLayoutDirection }; /** - wxLanguageInfo: encapsulates ::wxLanguage to OS native lang.desc. - translation information + Encapsulates a ::wxLanguage indentifier together with OS-specific information + related to that language. */ struct WXDLLIMPEXP_BASE wxLanguageInfo { - /// ::wxLanguage id. It should be greater than wxLANGUAGE_USER_DEFINED. + /// ::wxLanguage id. + /// It should be greater than @c wxLANGUAGE_USER_DEFINED when defining your own + /// language info structure. int Language; - wxString CanonicalName; //!< Canonical name, e.g. fr_FR. -#ifdef __WXMSW__ - wxUint32 WinLang, //!< Win32 language identifiers (LANG_xxxx, SUBLANG_xxxx). - WinSublang; -#endif // __WXMSW__ - wxString Description; //!< Human-readable name of the language. + + /// Canonical name of the language, e.g. @c fr_FR. + wxString CanonicalName; + + //@{ + /** + Win32 language identifiers (LANG_xxxx, SUBLANG_xxxx). + + @onlyfor{wxmsw} + */ + wxUint32 WinLang, WinSublang; + //@} + + /// Human-readable name of the language. + wxString Description; + + /// The layout direction used for this language. wxLayoutDirection LayoutDirection; -#ifdef __WXMSW__ /// Return the LCID corresponding to this language. + /// @onlyfor{wxmsw} wxUint32 GetLCID() const; -#endif // __WXMSW__ /// Return the locale name corresponding to this language usable with - /// setlocale() on the current system + /// @c setlocale() on the current system. wxString GetLocaleName() const; }; +/** + The category of locale settings. + + @see wxLocale::GetInfo() +*/ +enum wxLocaleCategory +{ + /// Number formatting. + wxLOCALE_CAT_NUMBER, + + /// Date/time formatting. + wxLOCALE_CAT_DATE, + + /// Monetary values formatting. + wxLOCALE_CAT_MONEY, + + /** + Default category for the wxLocaleInfo value. + + This category can be used for values which only make sense for a single + category, e.g. wxLOCALE_SHORT_DATE_FMT which can only be used with + wxLOCALE_CAT_DATE. As this is the default value of the second parameter + of wxLocale::GetInfo(), wxLOCALE_CAT_DATE can be omitted when asking + for wxLOCALE_SHORT_DATE_FMT value. + + @since 2.9.0 + */ + wxLOCALE_CAT_DEFAULT +}; + +/** + The values understood by wxLocale::GetInfo(). + + Note that for the @c wxLOCALE_*_FMT constants (the date and time formats), + the strings returned by wxLocale::GetInfo() use strftime() or, + equivalently, wxDateTime::Format() format. If the relevant format + couldn't be determined, an empty string is returned -- there is no + fallback value so that the application could determine the best course + of actions itself in such case. + + All of these values are used with @c wxLOCALE_CAT_DATE in wxLocale::GetInfo() or, + more typically, with @c wxLOCALE_CAT_DEFAULT as they only apply to a single category. +*/ +enum wxLocaleInfo +{ + /** + The thousands separator. + + This value can be used with either wxLOCALE_CAT_NUMBER or + wxLOCALE_CAT_MONEY categories. + */ + wxLOCALE_THOUSANDS_SEP, + + /** + The character used as decimal point. + + This value can be used with either wxLOCALE_CAT_NUMBER or + wxLOCALE_CAT_MONEY categories. + */ + wxLOCALE_DECIMAL_POINT, + + /** + Short date format. + + Notice that short and long date formats may be the same under POSIX + systems currently but may, and typically are, different under MSW or OS X. + + @since 2.9.0 + */ + wxLOCALE_SHORT_DATE_FMT, + + /** + Long date format. + + @since 2.9.0 + */ + wxLOCALE_LONG_DATE_FMT, + + /** + Date and time format. + + @since 2.9.0 + */ + wxLOCALE_DATE_TIME_FMT, + + /** + Time format. + + @since 2.9.0 + */ + wxLOCALE_TIME_FMT +}; + + /** @class wxLocale @@ -351,7 +458,7 @@ struct WXDLLIMPEXP_BASE wxLanguageInfo @endWxPerlOnly @library{wxbase} - @category{misc} + @category{cfg} @see @ref overview_i18n, @ref page_samples_internat, wxXLocale */ @@ -607,11 +714,29 @@ public: /** Tries to detect the user's default language setting. - Returns the ::wxLanguage value or @b wxLANGUAGE_UNKNOWN if the language-guessing + + Returns the ::wxLanguage value or @c wxLANGUAGE_UNKNOWN if the language-guessing algorithm failed. */ static int GetSystemLanguage(); + /** + Get the values of the given locale-dependent datum. + + This function returns the value of the locale-specific option specified + by the given @a index. + + @param index + One of the elements of wxLocaleInfo enum. + @param cat + The category to use with the given index or wxLOCALE_CAT_DEFAULT if + the index can only apply to a single category. + @return + The option value or empty string if the function failed. + */ + static wxString GetInfo(wxLocaleInfo index, + wxLocaleCategory cat = wxLOCALE_CAT_DEFAULT); + /** Initializes the wxLocale instance.