Skip to content

Commit

Permalink
FIX: set the default language to local if supported
Browse files Browse the repository at this point in the history
Change-Id: I03fb37dc4d28bb354c7711afde6d8fb389daa53f
  • Loading branch information
lanewei120 committed Jul 23, 2022
1 parent 7a68cc5 commit 5527ebb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@ bool GUI_App::on_init_inner()
preset_bundle->set_default_suppressed(true);

Bind(EVT_USER_LOGIN, &GUI_App::on_user_login, this);

on_init_network();

//BBS if load user preset failed
Expand Down Expand Up @@ -2065,7 +2065,7 @@ bool GUI_App::on_init_inner()
//#endif //__APPLE__

Bind(EVT_HTTP_ERROR, &GUI_App::on_http_error, this);


Bind(wxEVT_IDLE, [this](wxIdleEvent& event)
{
Expand Down Expand Up @@ -3610,7 +3610,7 @@ bool GUI_App::load_language(wxString language, bool initial)
m_language_info_system = wxLocale::GetLanguageInfo(lang_system);
BOOST_LOG_TRIVIAL(trace) << boost::format("System language detected (user locales and such): %1%") % m_language_info_system->CanonicalName.ToUTF8().data();
// BBS set language to app config
//app_config->set("language", m_language_info_system->CanonicalName.ToUTF8().data());
app_config->set("language", m_language_info_system->CanonicalName.ToUTF8().data());
} else {
{
std::map<wxString, wxString> language_descptions = {
Expand Down Expand Up @@ -3645,7 +3645,7 @@ bool GUI_App::load_language(wxString language, bool initial)
m_language_info_best = wxLocale::FindLanguageInfo(best_language);
BOOST_LOG_TRIVIAL(trace) << boost::format("Best translation language detected (may be different from user locales): %1%") %
m_language_info_best->CanonicalName.ToUTF8().data();
//app_config->set("language", m_language_info_best->CanonicalName.ToUTF8().data());
app_config->set("language", m_language_info_best->CanonicalName.ToUTF8().data());
}
#ifdef __linux__
wxString lc_all;
Expand Down Expand Up @@ -3717,7 +3717,7 @@ bool GUI_App::load_language(wxString language, bool initial)
language_info = wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_UK);
app_config->set("language", language_info->CanonicalName.ToUTF8().data());
}
else {
else if (initial) {
// bbs supported languages
//TODO: use a global one with Preference
wxLanguage supported_languages[] {wxLANGUAGE_ENGLISH, wxLANGUAGE_CHINESE_SIMPLIFIED, wxLANGUAGE_GERMAN, wxLANGUAGE_FRENCH, wxLANGUAGE_SPANISH, wxLANGUAGE_SWEDISH, wxLANGUAGE_DUTCH };
Expand Down

0 comments on commit 5527ebb

Please sign in to comment.