diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index 9a641c7c04..e548027707 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -104,6 +104,7 @@ const std::string& shortkey_alt_prefix() bool config_wizard_startup(bool app_config_exists) { if (!app_config_exists || wxGetApp().preset_bundle->printers.size() <= 1) { + wxGetApp().switch_language(); config_wizard(ConfigWizard::RR_DATA_EMPTY); return true; } else if (get_app_config()->legacy_datadir()) { diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0ce137cd10..626e62cd8e 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -255,7 +255,7 @@ bool GUI_App::on_init_inner() CallAfter([this] { if (!config_wizard_startup(app_conf_exists)) { - // Only notify if there was not wizard so as not to bother too much ... + // Only notify if there was no wizard so as not to bother too much ... preset_updater->slic3r_update_notify(); } preset_updater->sync(preset_bundle); @@ -514,6 +514,21 @@ void GUI_App::import_model(wxWindow *parent, wxArrayString& input_files) dialog.GetPaths(input_files); } +bool GUI_App::switch_language() +{ + wxArrayString names; + wxArrayLong identifiers; + get_installed_languages(names, identifiers); + if (select_language(names, identifiers)) { + save_language(); + _3DScene::remove_all_canvases(); + recreate_GUI(); + return true; + } else { + return false; + } +} + // select language from the list of installed languages bool GUI_App::select_language( wxArrayString & names, wxArrayLong & identifiers) @@ -753,14 +768,7 @@ void GUI_App::add_config_menu(wxMenuBar *menu) if ( dialog.ShowModal() == wxID_CANCEL) return; - wxArrayString names; - wxArrayLong identifiers; - get_installed_languages(names, identifiers); - if (select_language(names, identifiers)) { - save_language(); - _3DScene::remove_all_canvases();// remove all canvas before recreate GUI - recreate_GUI(); - } + switch_language(); break; } case ConfigMenuFlashFirmware: diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 60dc7c2faf..e6b94ece6f 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -127,6 +127,7 @@ public: void persist_window_geometry(wxTopLevelWindow *window, bool default_maximized = false); void update_ui_from_settings(); + bool switch_language(); bool select_language(wxArrayString & names, wxArrayLong & identifiers); bool load_language(); void save_language();