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