" + from_u8((boost::format(_utf8(L("Incompatible with this %s"))) % SLIC3R_APP_NAME).str()) + "
"; + text += "" + wxString::Format(_L("Incompatible with this %s"), SLIC3R_APP_NAME) + "
"; } else if (! snapshot_active) - text += ""; + text += ""; text += ""; text += ""; return text; diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 3504cb7f0..dbc6fa725 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -1200,8 +1200,8 @@ PageReloadFromDisk::PageReloadFromDisk(ConfigWizard* parent) PageFilesAssociation::PageFilesAssociation(ConfigWizard* parent) : ConfigWizardPage(parent, _L("Files association"), _L("Files association")) { - cb_3mf = new wxCheckBox(this, wxID_ANY, _L("Associate .3mf files to " SLIC3R_APP_NAME)); - cb_stl = new wxCheckBox(this, wxID_ANY, _L("Associate .stl files to " SLIC3R_APP_NAME)); + cb_3mf = new wxCheckBox(this, wxID_ANY, from_u8((boost::format(_u8L("Associate .3mf files to %1%")) % SLIC3R_APP_NAME).str())); + cb_stl = new wxCheckBox(this, wxID_ANY, from_u8((boost::format(_u8L("Associate .stl files to %1%")) % SLIC3R_APP_NAME).str())); // cb_gcode = new wxCheckBox(this, wxID_ANY, _L("Associate .gcode files to PrusaSlicer G-code Viewer")); append(cb_3mf); @@ -1214,10 +1214,10 @@ PageFilesAssociation::PageFilesAssociation(ConfigWizard* parent) PageMode::PageMode(ConfigWizard *parent) : ConfigWizardPage(parent, _L("View mode"), _L("View mode")) { - append_text(_L(SLIC3R_APP_NAME "'s user interfaces comes in three variants:\nSimple, Advanced, and Expert.\n" + append_text(wxString::Format(_L("%s's user interfaces comes in three variants:\nSimple, Advanced, and Expert.\n" "The Simple mode shows only the most frequently used settings relevant for regular 3D printing. " "The other two offer progressively more sophisticated fine-tuning, " - "they are suitable for advanced and expert users, respectively.")); + "they are suitable for advanced and expert users, respectively."), SLIC3R_APP_NAME)); radio_simple = new wxRadioButton(this, wxID_ANY, _L("Simple mode")); radio_advanced = new wxRadioButton(this, wxID_ANY, _L("Advanced mode")); diff --git a/src/slic3r/GUI/FreeCADDialog.cpp b/src/slic3r/GUI/FreeCADDialog.cpp index f99b0c0e5..754a78e3b 100644 --- a/src/slic3r/GUI/FreeCADDialog.cpp +++ b/src/slic3r/GUI/FreeCADDialog.cpp @@ -168,7 +168,7 @@ FreeCADDialog::~FreeCADDialog() { } FreeCADDialog::FreeCADDialog(GUI_App* app, MainFrame* mainframe) - : DPIDialog(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _(L("FreePySCAD : script engine for FreeCAD")), + : DPIDialog(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _L("FreePySCAD : script engine for FreeCAD"), //#if ENABLE_SCROLLABLE wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) //#else diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0fe08eb5b..3299cd63a 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -609,9 +609,9 @@ static void generic_exception_handle() BOOST_LOG_TRIVIAL(error) << boost::format("std::bad_alloc exception: %1%") % ex.what(); std::terminate(); } catch (const boost::io::bad_format_string& ex) { - wxString errmsg = _L(SLIC3R_APP_NAME " has encountered a localization error. " - "Please report to " SLIC3R_APP_NAME " team, what language was active and in which scenario " - "this issue happened. Thank you.\n\nThe application will now terminate."); + wxString errmsg = wxString::Format(_L( "%s has encountered a localization error. " + "Please report to %s team, what language was active and in which scenario " + "this issue happened. Thank you.\n\nThe application will now terminate."), SLIC3R_APP_NAME, SLIC3R_APP_NAME); wxMessageBox(errmsg + "\n\n" + wxString(ex.what()), _L("Critical error"), wxOK | wxICON_ERROR); BOOST_LOG_TRIVIAL(error) << boost::format("Uncaught exception: %1%") % ex.what(); std::terminate(); @@ -744,14 +744,14 @@ void GUI_App::init_app_config() // Error while parsing config file. We'll customize the error message and rethrow to be displayed. if (is_editor()) { throw Slic3r::RuntimeError( - _u8L("Error parsing " SLIC3R_APP_NAME " config file, it is probably corrupted. " - "Try to manually delete the file to recover from the error. Your user profiles will not be affected.") + + (boost::format(_u8L("Error parsing %1% config file, it is probably corrupted. " + "Try to manually delete the file to recover from the error. Your user profiles will not be affected.")) % std::string(SLIC3R_APP_NAME)).str() + "\n\n" + app_config->config_path() + "\n\n" + error); } else { throw Slic3r::RuntimeError( - _u8L("Error parsing " GCODEVIEWER_APP_NAME " config file, it is probably corrupted. " - "Try to manually delete the file to recover from the error.") + + (boost::format(_u8L("Error parsing %1% config file, it is probably corrupted. " + "Try to manually delete the file to recover from the error.")) % std::string(GCODEVIEWER_APP_NAME)).str() + "\n\n" + app_config->config_path() + "\n\n" + error); } } @@ -1218,8 +1218,8 @@ void GUI_App::check_printer_presets() for (const std::string& preset_name : preset_names) msg_text += "\n \"" + from_u8(preset_name) + "\","; msg_text.RemoveLast(); - msg_text += "\n\n" + _L("But since this version of " SLIC3R_APP_NAME " we don't show this information in Printer Settings anymore.\n" - "Settings will be available in physical printers settings.") + "\n\n" + + msg_text += "\n\n" + wxString::Format(_L("But since this version of %s we don't show this information in Printer Settings anymore.\n" + "Settings will be available in physical printers settings."), SLIC3R_APP_NAME) + "\n\n" + _L("By default new Printer devices will be named as \"Printer N\" during its creation.\n" "Note: This name can be changed later from the physical printers settings"); @@ -1319,7 +1319,7 @@ void GUI_App::change_calibration_dialog(const wxDialog* have_to_destroy, wxDialo void GUI_App::html_dialog() { - change_calibration_dialog(nullptr, new HtmlDialog(this, mainframe,"Introduction to calibrations", "/calibration/introduction.html")); + change_calibration_dialog(nullptr, new HtmlDialog(this, mainframe,"Introduction to calibrations", "/calibration", "introduction.html")); } void GUI_App::bed_leveling_dialog() { diff --git a/src/slic3r/GUI/GUI_Init.cpp b/src/slic3r/GUI/GUI_Init.cpp index a5561d7a5..413bc632d 100644 --- a/src/slic3r/GUI/GUI_Init.cpp +++ b/src/slic3r/GUI/GUI_Init.cpp @@ -85,10 +85,10 @@ int GUI_Run(GUI_InitParams ¶ms) return result; } catch (const Slic3r::Exception &ex) { boost::nowide::cerr << ex.what() << std::endl; - wxMessageBox(boost::nowide::widen(ex.what()), _L(SLIC3R_APP_NAME " GUI initialization failed"), wxICON_STOP); + wxMessageBox(boost::nowide::widen(ex.what()), wxString::Format(_L("%s GUI initialization failed"), SLIC3R_APP_NAME), wxICON_STOP); } catch (const std::exception &ex) { boost::nowide::cerr << SLIC3R_APP_NAME << " GUI initialization failed: " << ex.what() << std::endl; - wxMessageBox(format_wxstr(_L("Fatal error, exception catched: %1%"), ex.what()), _L(SLIC3R_APP_NAME " GUI initialization failed"), wxICON_STOP); + wxMessageBox(format_wxstr(_L("Fatal error, exception catched: %1%"), ex.what()), wxString::Format(_L("%s GUI initialization failed"), SLIC3R_APP_NAME), wxICON_STOP); } // error diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 354b7f6c4..498b2ff34 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -241,19 +241,19 @@ bool Preview::init(wxWindow* parent, Model* model) m_bottom_toolbar_panel = new wxPanel(this); m_label_view_type = new wxStaticText(m_bottom_toolbar_panel, wxID_ANY, _L("View")); m_choice_view_type = new wxChoice(m_bottom_toolbar_panel, wxID_ANY); - m_choice_view_label[GCodeViewer::EViewType::FeatureType] = wxString(_L(m_width_screen == tiny ? "Feature" : "Feature type")); - m_choice_view_label[GCodeViewer::EViewType::Height] = wxString(_L("Height")); - m_choice_view_label[GCodeViewer::EViewType::Width] = wxString(_L("Width")); - m_choice_view_label[GCodeViewer::EViewType::Feedrate] = wxString(_L("Speed")); - m_choice_view_label[GCodeViewer::EViewType::FanSpeed] = wxString(_L(m_width_screen == tiny ? "Fan" : "Fan speed")); - m_choice_view_label[GCodeViewer::EViewType::LayerTime] = wxString(_L(m_width_screen == tiny ? "time" : "Layer time")); - m_choice_view_label[GCodeViewer::EViewType::LayerTimeLog] = wxString(_L(m_width_screen == tiny ? "Log time" : "Layer time (log)")); - m_choice_view_label[GCodeViewer::EViewType::Chronology] = wxString(_L(m_width_screen == tiny ? "Chrono" : "Chronology")); - m_choice_view_label[GCodeViewer::EViewType::VolumetricRate] = wxString(_L(m_width_screen == tiny ? "Vol. flow" : "Volumetric flow rate")); - m_choice_view_label[GCodeViewer::EViewType::Tool] = wxString(_L("Tool")); - m_choice_view_label[GCodeViewer::EViewType::Filament] = wxString(_L("Filament")); - m_choice_view_label[GCodeViewer::EViewType::ColorPrint] = wxString(_L(m_width_screen == tiny ? "Color" : "Color Print")); - m_choice_view_label[GCodeViewer::EViewType::ExtruderTemp] = wxString(_L((m_width_screen == tiny ? "Temp" : "Temperature"))); + m_choice_view_label[GCodeViewer::EViewType::FeatureType] = m_width_screen == tiny ? _L("Feature") : _L("Feature type"); + m_choice_view_label[GCodeViewer::EViewType::Height] = _L("Height"); + m_choice_view_label[GCodeViewer::EViewType::Width] = _L("Width"); + m_choice_view_label[GCodeViewer::EViewType::Feedrate] = _L("Speed"); + m_choice_view_label[GCodeViewer::EViewType::FanSpeed] = m_width_screen == tiny ? _L("Fan") : _L("Fan speed"); + m_choice_view_label[GCodeViewer::EViewType::LayerTime] = m_width_screen == tiny ? _L("time") : _L("Layer time"); + m_choice_view_label[GCodeViewer::EViewType::LayerTimeLog] = m_width_screen == tiny ? _L("Log time") : _L("Layer time (log)"); + m_choice_view_label[GCodeViewer::EViewType::Chronology] = m_width_screen == tiny ? _L("Chrono") : _L("Chronology"); + m_choice_view_label[GCodeViewer::EViewType::VolumetricRate] = m_width_screen == tiny ? _L("Vol. flow") : _L("Volumetric flow rate"); + m_choice_view_label[GCodeViewer::EViewType::Tool] = _L("Tool"); + m_choice_view_label[GCodeViewer::EViewType::Filament] = _L("Filament"); + m_choice_view_label[GCodeViewer::EViewType::ColorPrint] = m_width_screen == tiny ? _L("Color") : _L("Color Print"); + m_choice_view_label[GCodeViewer::EViewType::ExtruderTemp] = m_width_screen == tiny ? _L("Temp") : _L("Temperature"); for(int i=0; i < (int)GCodeViewer::EViewType::Count; i++) m_choice_view_type->Append(m_choice_view_label[(GCodeViewer::EViewType)i]); m_choice_view_type->SetSelection(0); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index ca2b3d6c1..2e9065b78 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1086,11 +1086,11 @@ static const wxString sep_space = ""; static wxMenu* generate_help_menu() { wxMenu* helpMenu = new wxMenu(); - append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " Releases"), wxString::Format(_L("Open the %s releases page in your browser"), SLIC3R_APP_NAME), + append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("%s Releases"), SLIC3R_APP_NAME), wxString::Format(_L("Open the %s releases page in your browser"), SLIC3R_APP_NAME), [](wxCommandEvent&) { wxLaunchDefaultBrowser(SLIC3R_DOWNLOAD); }); - append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " wiki"), wxString::Format(_L("Open the %s wiki in your browser"), SLIC3R_APP_NAME), + append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("%s wiki"), SLIC3R_APP_NAME), wxString::Format(_L("Open the %s wiki in your browser"), SLIC3R_APP_NAME), [](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/" SLIC3R_GITHUB "/wiki"); }); - append_menu_item(helpMenu, wxID_ANY, _L(SLIC3R_APP_NAME " website"), _L("Open the Slic3r website in your browser"), + append_menu_item(helpMenu, wxID_ANY, wxString::Format(_L("%s website"), SLIC3R_APP_NAME), _L("Open the Slic3r website in your browser"), [](wxCommandEvent&) { wxLaunchDefaultBrowser("http://slic3r.org"); }); //# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{ //# wxTheApp->check_version(1); @@ -1417,7 +1417,7 @@ void MainFrame::init_menubar_as_editor() [this](wxCommandEvent&) { m_printhost_queue_dlg->Show(); }, "upload_queue", nullptr, []() {return true; }, this); windowMenu->AppendSeparator(); - append_menu_item(windowMenu, wxID_ANY, _L("Open new instance") + "\tCtrl+Shift+" + "I", _L("Open a new " SLIC3R_APP_NAME " instance"), + append_menu_item(windowMenu, wxID_ANY, _L("Open new instance") + "\tCtrl+Shift+" + "I", wxString::Format(_L("Open a new %s instance"), SLIC3R_APP_NAME), [this](wxCommandEvent&) { start_new_slicer(); }, "", nullptr, [this]() {return m_plater != nullptr && wxGetApp().app_config->get("single_instance") != "1"; }, this); } @@ -1527,7 +1527,7 @@ void MainFrame::init_menubar_as_gcodeviewer() append_menu_item(fileMenu, wxID_ANY, _L("Export &toolpaths as OBJ") + dots, _L("Export toolpaths as OBJ"), [this](wxCommandEvent&) { if (m_plater != nullptr) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr, [this]() {return can_export_toolpaths(); }, this); - append_menu_item(fileMenu, wxID_ANY, _L("O&pen " SLIC3R_APP_NAME) + dots, _L("Open " SLIC3R_APP_NAME), + append_menu_item(fileMenu, wxID_ANY, wxString::Format(_L("O&pen %s"), SLIC3R_APP_NAME) + dots, wxString::Format(_L("Open %s"), SLIC3R_APP_NAME), [this](wxCommandEvent&) { start_new_slicer(); }, "", nullptr, [this]() {return true; }, this); fileMenu->AppendSeparator(); diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index a96e5b2dd..b989c8661 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -176,11 +176,9 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/) // add label if any if (!option.label.empty()) { std::string opt_label = (option.label.empty() || option.label.back() != '_') ? option.label : option.label.substr(0, option.label.size() - 1); - std::cout << "translate '" << opt_label << "' to '"; //! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1 label = /*(opt_label == L_CONTEXT("Top", "Layers") || opt_label == L_CONTEXT("Bottom", "Layers")) ? _CTX(opt_label, "Layers") :*/ _(opt_label); - std::cout << label << "'\n"; bool no_dots = label.empty() || option.label.back() == '_'; if (!no_dots) label += ":"; @@ -820,11 +818,11 @@ RememberChoiceDialog::RememberChoiceDialog(wxWindow* parent, const wxString& msg return; wxString preferences_item = _L("Suppress to open hyperlink in browser"); wxString msg = - _L(SLIC3R_APP_NAME " will remember your choice.") + "\n\n" + + wxString::Format(_L("%s will remember your choice."), SLIC3R_APP_NAME) + "\n\n" + _L("You will not be asked about it again on label hovering.") + "\n\n" + format_wxstr(_L("Visit \"Preferences\" and check \"%1%\"\nto changes your choice."), preferences_item); - wxMessageDialog dialog(nullptr, msg, _L(SLIC3R_APP_NAME ": Don't ask me again"), wxOK | wxCANCEL | wxICON_INFORMATION); + wxMessageDialog dialog(nullptr, msg, wxString::Format(_L("%s: Don't ask me again"), SLIC3R_APP_NAME), wxOK | wxCANCEL | wxICON_INFORMATION); if (dialog.ShowModal() == wxID_CANCEL) m_remember_choice->SetValue(false); }); diff --git a/src/slic3r/GUI/OpenGLManager.cpp b/src/slic3r/GUI/OpenGLManager.cpp index b6b1757e3..b90bbba81 100644 --- a/src/slic3r/GUI/OpenGLManager.cpp +++ b/src/slic3r/GUI/OpenGLManager.cpp @@ -257,14 +257,15 @@ bool OpenGLManager::init_gl() bool valid_version = s_gl_info.is_version_greater_or_equal_to(2, 0); if (!valid_version) { // Complain about the OpenGL version. - wxString message = from_u8((boost::format( - _utf8(L(SLIC3R_APP_NAME " requires OpenGL 2.0 capable graphics driver to run correctly, \n" - "while OpenGL version %s, render %s, vendor %s was detected."))) % s_gl_info.get_version() % s_gl_info.get_renderer() % s_gl_info.get_vendor()).str()); + wxString message = wxString::Format( + _L( "%s requires OpenGL 2.0 capable graphics driver to run correctly, \n" + "while OpenGL version %s, render %s, vendor %s was detected."), + SLIC3R_APP_NAME, s_gl_info.get_version(), s_gl_info.get_renderer(), s_gl_info.get_vendor()); message += "\n"; message += _L("You may need to update your graphics card driver."); #ifdef _WIN32 message += "\n"; - message += _L("As a workaround, you may run " SLIC3R_APP_NAME " with a software rendered 3D graphics by running " SLIC3R_APP_CMD ".exe with the --sw-renderer parameter."); + message += wxString::Format(_L("As a workaround, you may run %s with a software rendered 3D graphics by running %s.exe with the --sw-renderer parameter."), SLIC3R_APP_NAME, SLIC3R_APP_CMD); #endif wxMessageBox(message, wxString(SLIC3R_APP_NAME " - ") + _L("Unsupported OpenGL version"), wxOK | wxICON_ERROR); } diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index e42b3a04b..48a2d39ec 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -96,7 +96,7 @@ void PreferencesDialog::build() // Please keep in sync with ConfigWizard def.label = L("Check for application updates"); def.type = coBool; - def.tooltip = L("If enabled, " SLIC3R_APP_NAME " will check for the new versions of itself online. When a new version becomes available a notification is displayed at the next application startup (never during program usage). This is only a notification mechanisms, no automatic installation is done."); + def.tooltip = L("If enabled, Slic3r will check for the new versions of itself online. When a new version becomes available a notification is displayed at the next application startup (never during program usage). This is only a notification mechanisms, no automatic installation is done."); def.set_default_value(new ConfigOptionBool(app_config->get("version_check") == "1")); option = Option(def, "version_check"); m_optgroup_general->append_single_option_line(option); @@ -380,8 +380,8 @@ void PreferencesDialog::build() def.label = L("Tab icon size"); def.type = coInt; - def.tooltip = std::string(L("Size of the tab icons, in pixels. Set to 0 to remove icons.")) - + std::string(L("\nYou have to restart the application before any change will be taken into account.")); + def.tooltip = L("Size of the tab icons, in pixels. Set to 0 to remove icons." + "\nYou have to restart the application before any change will be taken into account."); def.set_default_value(new ConfigOptionInt{ atoi(app_config->get("tab_icon_size").c_str()) }); option = Option(def, "tab_icon_size"); option.opt.width = 6; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5e690e484..a8fcce485 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1956,12 +1956,12 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page) } else if (boost::starts_with(full_line, "print_host_upload_description")) { TabPrinter* tab = nullptr; if ((tab = dynamic_cast