diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index dfa783927..a143051e0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -213,7 +213,7 @@ void PrintConfigDef::init_fff_params() def = this->add("clip_multipart_objects", coBool); def->label = L("Clip multi-part objects"); - def->tooltip = L("When printing multi-material objects, this settings will make slic3r " + def->tooltip = L("When printing multi-material objects, this settings will make Slic3r " "to clip the overlapping object parts one by the other " "(2nd part will be clipped by the 1st, 3rd part will be clipped by the 1st and 2nd etc)."); def->mode = comExpert; diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 738ec2e00..88ed7a445 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -100,6 +100,7 @@ wxString Field::get_tooltip_text(const wxString& default_string) { wxString tooltip_text(""); wxString tooltip = _(m_opt.tooltip); + edit_tooltip(tooltip); if (tooltip.length() > 0) tooltip_text = tooltip + "\n" + _(L("default value")) + "\t: " + (boost::iends_with(m_opt_id, "_gcode") ? "\n" : "") + default_string + diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 154b4475f..0ffdd576f 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -663,7 +663,7 @@ void GUI_App::add_config_menu(wxMenuBar *menu) Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Check(get_mode() == comAdvanced); }, config_id_base + ConfigMenuModeAdvanced); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Check(get_mode() == comExpert); }, config_id_base + ConfigMenuModeExpert); - local_menu->AppendSubMenu(mode_menu, _(L("Mode")), _(L("Slic3r View Mode"))); + local_menu->AppendSubMenu(mode_menu, _(L("Mode")), wxString::Format(_(L("%s View Mode")), SLIC3R_APP_NAME)); local_menu->AppendSeparator(); local_menu->Append(config_id_base + ConfigMenuLanguage, _(L("Change Application &Language"))); local_menu->AppendSeparator(); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index ccba1aaaa..5a63bedaa 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -360,7 +360,7 @@ void MainFrame::init_menubar() append_menu_item(fileMenu, wxID_ANY, _(L("&Repair STL file")) + dots, _(L("Automatically repair an STL file")), [this](wxCommandEvent&) { repair_stl(); }, "wrench"); fileMenu->AppendSeparator(); - append_menu_item(fileMenu, wxID_EXIT, _(L("&Quit")), _(L("Quit Slic3r")), + append_menu_item(fileMenu, wxID_EXIT, _(L("&Quit")), wxString::Format(_(L("Quit %s")), SLIC3R_APP_NAME), [this](wxCommandEvent&) { Close(false); }); Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(m_plater != nullptr); }, item_open->GetId()); @@ -497,9 +497,11 @@ void MainFrame::init_menubar() //# wxTheApp->check_version(1); //# }); //# $versioncheck->Enable(wxTheApp->have_version_check); - append_menu_item(helpMenu, wxID_ANY, _(L("Slic3r &Website")), _(L("Open the Slic3r website in your browser")), + append_menu_item(helpMenu, wxID_ANY, wxString::Format(_(L("%s &Website")), SLIC3R_APP_NAME), + wxString::Format(_(L("Open the %s website in your browser")), SLIC3R_APP_NAME), [this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org/"); }); - append_menu_item(helpMenu, wxID_ANY, _(L("Slic3r &Manual")), _(L("Open the Slic3r manual in your browser")), + append_menu_item(helpMenu, wxID_ANY, wxString::Format(_(L("%s &Manual")), SLIC3R_APP_NAME), + wxString::Format(_(L("Open the %s manual in your browser")), SLIC3R_APP_NAME), [this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://manual.slic3r.org/"); }); helpMenu->AppendSeparator(); append_menu_item(helpMenu, wxID_ANY, _(L("System &Info")), _(L("Show system information")), diff --git a/src/slic3r/GUI/MsgDialog.cpp b/src/slic3r/GUI/MsgDialog.cpp index 1de0baff7..ba2c5ed0c 100644 --- a/src/slic3r/GUI/MsgDialog.cpp +++ b/src/slic3r/GUI/MsgDialog.cpp @@ -70,7 +70,8 @@ MsgDialog::~MsgDialog() {} // ErrorDialog ErrorDialog::ErrorDialog(wxWindow *parent, const wxString &msg) - : MsgDialog(parent, _(L("Slic3r error")), _(L("Slic3r has encountered an error")), + : MsgDialog(parent, wxString::Format(_(L("%s error")), SLIC3R_APP_NAME), + wxString::Format(_(L("%s has encountered an error")), SLIC3R_APP_NAME), wxID_NONE) , msg(msg) { diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 099ebc8ba..144662a9f 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -307,7 +307,10 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** full_Label/* = n } Line OptionsGroup::create_single_option_line(const Option& option) const { - Line retval{ _(option.opt.label), _(option.opt.tooltip) }; +// Line retval{ _(option.opt.label), _(option.opt.tooltip) }; + wxString tooltip = _(option.opt.tooltip); + edit_tooltip(tooltip); + Line retval{ _(option.opt.label), tooltip }; Option tmp(option); tmp.opt.label = std::string(""); retval.append_option(tmp); diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 81d242d4f..b6a340d08 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -127,7 +127,7 @@ void PreferencesDialog::accept() { if (m_values.find("no_defaults") != m_values.end() || m_values.find("use_legacy_opengl") != m_values.end()) { - warning_catcher(this, _(L("You need to restart Slic3r to make the changes effective."))); + warning_catcher(this, wxString::Format(_(L("You need to restart %s to make the changes effective.")), SLIC3R_APP_NAME)); } auto app_config = get_app_config(); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index b57678e86..fb8147ad2 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1770,9 +1770,9 @@ void TabPrinter::build_printhost(ConfigOptionsGroup *optgroup) line.widget = [this, ca_file_hint] (wxWindow* parent) { auto txt = new wxStaticText(parent, wxID_ANY, wxString::Format("%s\n\n\t%s", - _(L("HTTPS CA File:\n\ -\tOn this system, Slic3r uses HTTPS certificates from the system Certificate Store or Keychain.\n\ -\tTo use a custom CA file, please import your CA file into Certificate Store / Keychain.")), + wxString::Format(_(L("HTTPS CA File:\n\ + \tOn this system, %s uses HTTPS certificates from the system Certificate Store or Keychain.\n\ + \tTo use a custom CA file, please import your CA file into Certificate Store / Keychain.")), SLIC3R_APP_NAME), ca_file_hint)); txt->SetFont(Slic3r::GUI::wxGetApp().normal_font()); auto sizer = new wxBoxSizer(wxHORIZONTAL); diff --git a/src/slic3r/GUI/UpdateDialogs.cpp b/src/slic3r/GUI/UpdateDialogs.cpp index 99288488c..b4943cf46 100644 --- a/src/slic3r/GUI/UpdateDialogs.cpp +++ b/src/slic3r/GUI/UpdateDialogs.cpp @@ -109,7 +109,8 @@ MsgUpdateConfig::~MsgUpdateConfig() {} // MsgDataIncompatible MsgDataIncompatible::MsgDataIncompatible(const std::unordered_map &incompats) : - MsgDialog(nullptr, _(L("Slic3r incompatibility")), _(L("Slic3r configuration is incompatible")), wxID_NONE) + MsgDialog(nullptr, wxString::Format(_(L("%s incompatibility")), SLIC3R_APP_NAME), + wxString::Format(_(L("%s configuration is incompatible")), SLIC3R_APP_NAME), wxID_NONE) { logo->SetBitmap(create_scaled_bitmap(this, "Slic3r_192px_grayscale.png", 192)); @@ -117,9 +118,9 @@ MsgDataIncompatible::MsgDataIncompatible(const std::unordered_mapWrap(CONTENT_WIDTH * wxGetApp().em_unit()); content_sizer->Add(text); @@ -144,7 +145,7 @@ MsgDataIncompatible::MsgDataIncompatible(const std::unordered_mapAdd(versions); content_sizer->AddSpacer(2*VERT_SPACING); - auto *btn_exit = new wxButton(this, wxID_EXIT, _(L("Exit Slic3r"))); + auto *btn_exit = new wxButton(this, wxID_EXIT, wxString::Format(_(L("Exit %s")), SLIC3R_APP_NAME)); btn_sizer->Add(btn_exit); btn_sizer->AddSpacer(HORIZ_SPACING); auto *btn_reconf = new wxButton(this, wxID_REPLACE, _(L("Re-configure"))); @@ -187,7 +188,7 @@ MsgDataLegacy::MsgDataLegacy() : auto *text2 = new wxStaticText(this, wxID_ANY, _(L("For more information please visit our wiki page:"))); static const wxString url("https://github.com/prusa3d/Slic3r/wiki/Slic3r-PE-1.40-configuration-update"); // The wiki page name is intentionally not localized: - auto *link = new wxHyperlinkCtrl(this, wxID_ANY, "Slic3r PE 1.40 configuration update", CONFIG_UPDATE_WIKI_URL); + auto *link = new wxHyperlinkCtrl(this, wxID_ANY, wxString::Format("%s 1.40 configuration update", SLIC3R_APP_NAME), CONFIG_UPDATE_WIKI_URL); content_sizer->Add(text2); content_sizer->Add(link); content_sizer->AddSpacer(VERT_SPACING); diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 573106ae7..d76e0da93 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -267,6 +267,13 @@ void wxDataViewTreeCtrlComboPopup::OnDataViewTreeCtrlSelection(wxCommandEvent& e cmb->SetText(selected); } +// edit tooltip : change Slic3r to SLIC3R_APP_KEY +// Temporary workaround for localization +void edit_tooltip(wxString& tooltip) +{ + tooltip.Replace("Slic3r", SLIC3R_APP_KEY, true); +} + /* Function for rescale of buttons in Dialog under MSW if dpi is changed. * btn_ids - vector of buttons identifiers */ diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index e40306ea1..589317f2b 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -32,6 +32,7 @@ wxMenuItem* append_menu_radio_item(wxMenu* menu, int id, const wxString& string, std::function cb, wxEvtHandler* event_handler); class wxDialog; +void edit_tooltip(wxString& tooltip); void msw_buttons_rescale(wxDialog* dlg, const int em_unit, const std::vector& btn_ids); int em_unit(wxWindow* win);