From 90a48ae7ce5da707fc6c9818a359b597d08a32b7 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 18 Oct 2016 11:00:11 +0200 Subject: [PATCH] wxInitializeLocale() upgraded to optionally return UI language --- include/wxex/common.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/wxex/common.h b/include/wxex/common.h index f8dee3b..5ad42c6 100644 --- a/include/wxex/common.h +++ b/include/wxex/common.h @@ -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 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 /// - \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;