wxInitializeLocale() upgraded to optionally return UI language
This commit is contained in:
parent
b644d08eac
commit
90a48ae7ce
@ -131,13 +131,14 @@ inline bool wxModifyStyleEx(_In_ WXHWND hWnd, _In_ DWORD dwRemove, _In_ DWORD dw
|
|||||||
/// The language identifier is read from `Language` configuration string ("ll_CC" form expected).
|
/// The language identifier is read from `Language` configuration string ("ll_CC" form expected).
|
||||||
/// The path to folder containing localization catalogue PO files is read from `LocalizationRepositoryPath` configuration string.
|
/// The path to folder containing localization catalogue PO files is read from `LocalizationRepositoryPath` configuration string.
|
||||||
///
|
///
|
||||||
/// \param[inout] locale Locale to initialize
|
/// \param[inout] locale Locale to initialize
|
||||||
|
/// \param[out ] language Translation language
|
||||||
///
|
///
|
||||||
/// \returns
|
/// \returns
|
||||||
/// - \c true when initialization succeeded
|
/// - \c true when initialization succeeded
|
||||||
/// - \c false otherwise
|
/// - \c false otherwise
|
||||||
///
|
///
|
||||||
inline bool wxInitializeLocale(wxLocale &locale)
|
inline bool wxInitializeLocale(wxLocale &locale, wxLanguage *language = NULL)
|
||||||
{
|
{
|
||||||
// Read language from configuration.
|
// Read language from configuration.
|
||||||
wxLanguage lang_code;
|
wxLanguage lang_code;
|
||||||
@ -148,6 +149,9 @@ inline bool wxInitializeLocale(wxLocale &locale)
|
|||||||
} else
|
} else
|
||||||
lang_code = wxLANGUAGE_DEFAULT;
|
lang_code = wxLANGUAGE_DEFAULT;
|
||||||
|
|
||||||
|
if (language)
|
||||||
|
*language = lang_code;
|
||||||
|
|
||||||
if (wxLocale::IsAvailable(lang_code)) {
|
if (wxLocale::IsAvailable(lang_code)) {
|
||||||
// Language is "available". Well... Known actually.
|
// Language is "available". Well... Known actually.
|
||||||
wxString sPath;
|
wxString sPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user