mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-02-26 08:22:31 +00:00
mmg: Get default locale if none has been selected yet
Get the default locale if none has been saved yet so that the preferences dialog shows the correct one as selected. Do not compile the locale code if libintl.h is not available. Add debug output for the language selection logic.
This commit is contained in:
parent
43cf1e2f54
commit
e08435900c
@ -2170,9 +2170,11 @@ END_EVENT_TABLE();
|
||||
|
||||
void
|
||||
mmg_app::init_ui_locale(wxConfigBase *cfg) {
|
||||
wxString w_locale;
|
||||
std::string locale;
|
||||
|
||||
#if defined(HAVE_LIBINTL_H)
|
||||
wxString w_locale;
|
||||
|
||||
translation_c::initialize_available_translations();
|
||||
|
||||
cfg->SetPath(wxT("/GUI"));
|
||||
@ -2182,7 +2184,11 @@ mmg_app::init_ui_locale(wxConfigBase *cfg) {
|
||||
locale = "";
|
||||
}
|
||||
|
||||
if (locale.empty())
|
||||
locale = translation_c::get_default_ui_locale();
|
||||
|
||||
m_ui_locale = locale;
|
||||
#endif // HAVE_LIBINTL_H
|
||||
|
||||
init_locales(locale);
|
||||
}
|
||||
|
@ -154,6 +154,9 @@ options_dialog::options_dialog(wxWindow *parent,
|
||||
++translation;
|
||||
}
|
||||
|
||||
wxLogMessage(wxT("Locale selection logic: select_locale %s uu_locale_lower %s translation_c::get_default_ui_locale() %s app->m_ui_locale %s"),
|
||||
select_locale.c_str(), wxCS2WS(ui_locale_lower), wxCS2WS(translation_c::get_default_ui_locale()), wxCS2WS(app->m_ui_locale));
|
||||
|
||||
std::sort(sorted_entries.begin(), sorted_entries.end());
|
||||
|
||||
std::vector<locale_sorter_t>::iterator locale_entry = sorted_entries.begin();
|
||||
|
Loading…
Reference in New Issue
Block a user