Language of character tags in Character Search dialog resolved to match UI language

This commit is contained in:
Simon Rozman 2016-10-18 11:00:40 +02:00
parent 6253f2c267
commit 2b2b2656b3
4 changed files with 7 additions and 4 deletions

View File

@ -32,6 +32,7 @@ wxIMPLEMENT_APP(ZRColaApp);
ZRColaApp::ZRColaApp() :
m_mainWnd(NULL),
m_lang_ui(wxLANGUAGE_DEFAULT),
wxApp()
{
}
@ -55,7 +56,7 @@ bool ZRColaApp::OnInit()
return false;
// Initialize locale.
if (wxInitializeLocale(m_locale)) {
if (wxInitializeLocale(m_locale, &m_lang_ui)) {
wxVERIFY(m_locale.AddCatalog(wxT("wxExtend") wxT(wxExtendVersion)));
wxVERIFY(m_locale.AddCatalog(wxT("UpdaterZRCola")));
wxVERIFY(m_locale.AddCatalog(wxT("libZRColaUI")));

View File

@ -84,6 +84,7 @@ public:
wxZRColaFrame *m_mainWnd; ///< Main window
wxLocale m_locale; ///< Current locale
wxLanguage m_lang_ui; ///< Translation language (language of User Interface, wxLANGUAGE_DEFAULT = English)
protected:
#ifdef __WXMSW__

View File

@ -35,8 +35,9 @@ wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) :
wxZRColaCharSelectBase(parent)
{
// Set tag lookup locale.
auto language = static_cast<wxLanguage>(dynamic_cast<ZRColaApp*>(wxTheApp)->m_locale.GetLanguage());
if (wxLANGUAGE_ENGLISH <= language && language <= wxLANGUAGE_ENGLISH_ZIMBABWE) m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);
wxLanguage language = dynamic_cast<ZRColaApp*>(wxTheApp)->m_lang_ui;
if (wxLANGUAGE_DEFAULT == language ||
wxLANGUAGE_ENGLISH <= language && language <= wxLANGUAGE_ENGLISH_ZIMBABWE) m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);
else if (wxLANGUAGE_RUSSIAN <= language && language <= wxLANGUAGE_RUSSIAN_UKRAINE ) m_locale = MAKELCID(MAKELANGID(LANG_RUSSIAN , SUBLANG_DEFAULT), SORT_DEFAULT);
else if (wxLANGUAGE_SLOVENIAN == language ) m_locale = MAKELCID(MAKELANGID(LANG_SLOVENIAN, SUBLANG_DEFAULT), SORT_DEFAULT);
else m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT);

@ -1 +1 @@
Subproject commit b644d08eac98260556cf3d059a2d272f98955097
Subproject commit 05627f98d6b9f2cca5ac9765d516353fb17e0e6a