Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/slic3r')
-rw-r--r--src/slic3r/GUI/CalibrationAbstractDialog.cpp21
-rw-r--r--src/slic3r/GUI/CalibrationAbstractDialog.hpp4
-rw-r--r--src/slic3r/GUI/CalibrationBedDialog.hpp2
-rw-r--r--src/slic3r/GUI/CalibrationBridgeDialog.hpp2
-rw-r--r--src/slic3r/GUI/CalibrationCubeDialog.hpp2
-rw-r--r--src/slic3r/GUI/CalibrationFlowDialog.hpp2
-rw-r--r--src/slic3r/GUI/CalibrationOverBridgeDialog.hpp2
-rw-r--r--src/slic3r/GUI/CalibrationRetractionDialog.hpp2
-rw-r--r--src/slic3r/GUI/CalibrationTempDialog.hpp2
-rw-r--r--src/slic3r/GUI/ConfigSnapshotDialog.cpp22
-rw-r--r--src/slic3r/GUI/ConfigWizard.cpp8
-rw-r--r--src/slic3r/GUI/FreeCADDialog.cpp2
-rw-r--r--src/slic3r/GUI/GUI_App.cpp20
-rw-r--r--src/slic3r/GUI/GUI_Init.cpp4
-rw-r--r--src/slic3r/GUI/GUI_Preview.cpp26
-rw-r--r--src/slic3r/GUI/MainFrame.cpp10
-rw-r--r--src/slic3r/GUI/OG_CustomCtrl.cpp6
-rw-r--r--src/slic3r/GUI/OpenGLManager.cpp9
-rw-r--r--src/slic3r/GUI/Preferences.cpp6
-rw-r--r--src/slic3r/GUI/Tab.cpp4
20 files changed, 86 insertions, 70 deletions
diff --git a/src/slic3r/GUI/CalibrationAbstractDialog.cpp b/src/slic3r/GUI/CalibrationAbstractDialog.cpp
index 81783bea2..4b72513f6 100644
--- a/src/slic3r/GUI/CalibrationAbstractDialog.cpp
+++ b/src/slic3r/GUI/CalibrationAbstractDialog.cpp
@@ -40,14 +40,31 @@ namespace GUI {
}
-void CalibrationAbstractDialog::create(std::string html_path, wxSize dialog_size){
+void CalibrationAbstractDialog::create(std::string html_path, std::string html_name, wxSize dialog_size){
auto main_sizer = new wxBoxSizer(wxVERTICAL);
+ //language
+ wxString language = wxGetApp().current_language_code();
+ std::string full_file_path = Slic3r::resources_dir() + html_path+"/"+ into_u8(language)+"_"+ html_name;
+ if (language == "en") {
+ full_file_path = Slic3r::resources_dir() + html_path + "/" + html_name;
+ }else if (!boost::filesystem::exists(full_file_path)) {
+ language = wxGetApp().current_language_code_safe();
+ full_file_path = Slic3r::resources_dir() + html_path + "/" + into_u8(language) + "_" + html_name;
+ if (!boost::filesystem::exists(full_file_path)) {
+ language = language.IsEmpty() ? "en" : language.BeforeFirst('_');
+ full_file_path = Slic3r::resources_dir() + html_path + "/" + into_u8(language) + "_" + html_name;
+ if (!boost::filesystem::exists(full_file_path)) {
+ full_file_path = Slic3r::resources_dir() + html_path + "/" + html_name;
+ }
+ }
+ }
+
//html
html_viewer = new wxHtmlWindow(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
- html_viewer->LoadPage(Slic3r::resources_dir()+ html_path);
+ html_viewer->LoadPage(full_file_path);
main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5);
wxDisplay display(wxDisplay::GetFromWindow(main_frame));
diff --git a/src/slic3r/GUI/CalibrationAbstractDialog.hpp b/src/slic3r/GUI/CalibrationAbstractDialog.hpp
index 96706af8e..71da1eb63 100644
--- a/src/slic3r/GUI/CalibrationAbstractDialog.hpp
+++ b/src/slic3r/GUI/CalibrationAbstractDialog.hpp
@@ -25,7 +25,7 @@ public:
private:
wxPanel* create_header(wxWindow* parent, const wxFont& bold_font);
protected:
- void create(std::string html_path, wxSize dialogsize = wxSize(850, 550));
+ void create(std::string html_path, std::string html_name, wxSize dialogsize = wxSize(850, 550));
virtual void create_buttons(wxStdDialogButtonSizer*) = 0;
void on_dpi_changed(const wxRect& suggested_rect) override;
void close_me(wxCommandEvent& event_args);
@@ -42,7 +42,7 @@ class HtmlDialog : public CalibrationAbstractDialog
{
public:
- HtmlDialog(GUI_App* app, MainFrame* mainframe, std::string title, std::string html_path) : CalibrationAbstractDialog(app, mainframe, title) { create(html_path); }
+ HtmlDialog(GUI_App* app, MainFrame* mainframe, std::string title, std::string html_path, std::string html_name) : CalibrationAbstractDialog(app, mainframe, title) { create(html_path, html_name); }
virtual ~HtmlDialog() {}
protected:
void create_buttons(wxStdDialogButtonSizer* sizer) override {}
diff --git a/src/slic3r/GUI/CalibrationBedDialog.hpp b/src/slic3r/GUI/CalibrationBedDialog.hpp
index 311128ffe..dfe38352a 100644
--- a/src/slic3r/GUI/CalibrationBedDialog.hpp
+++ b/src/slic3r/GUI/CalibrationBedDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationBedDialog : public CalibrationAbstractDialog
{
public:
- CalibrationBedDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bed leveling calibration") { create("/calibration/bed_leveling/bed_leveling.html"); }
+ CalibrationBedDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bed leveling calibration") { create("/calibration/bed_leveling", "bed_leveling.html"); }
virtual ~CalibrationBedDialog() {}
protected:
void create_buttons(wxStdDialogButtonSizer* sizer) override;
diff --git a/src/slic3r/GUI/CalibrationBridgeDialog.hpp b/src/slic3r/GUI/CalibrationBridgeDialog.hpp
index becc86446..b60540db5 100644
--- a/src/slic3r/GUI/CalibrationBridgeDialog.hpp
+++ b/src/slic3r/GUI/CalibrationBridgeDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationBridgeDialog : public CalibrationAbstractDialog
{
public:
- CalibrationBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bridge calibration") { create("/calibration/bridge_flow/bridge_flow.html", wxSize(850, 400)); }
+ CalibrationBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bridge calibration") { create("/calibration/bridge_flow", "bridge_flow.html", wxSize(850, 400)); }
virtual ~CalibrationBridgeDialog() { }
protected:
diff --git a/src/slic3r/GUI/CalibrationCubeDialog.hpp b/src/slic3r/GUI/CalibrationCubeDialog.hpp
index 4ddec6373..4538c4c91 100644
--- a/src/slic3r/GUI/CalibrationCubeDialog.hpp
+++ b/src/slic3r/GUI/CalibrationCubeDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationCubeDialog : public CalibrationAbstractDialog
{
public:
- CalibrationCubeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Calibration cube") { create("/calibration/cube/cube.html"); }
+ CalibrationCubeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Calibration cube") { create("/calibration/cube", "cube.html"); }
virtual ~CalibrationCubeDialog(){ }
protected:
diff --git a/src/slic3r/GUI/CalibrationFlowDialog.hpp b/src/slic3r/GUI/CalibrationFlowDialog.hpp
index da1a605e7..51ff188f0 100644
--- a/src/slic3r/GUI/CalibrationFlowDialog.hpp
+++ b/src/slic3r/GUI/CalibrationFlowDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationFlowDialog : public CalibrationAbstractDialog
{
public:
- CalibrationFlowDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create("/calibration/filament_flow/filament_flow.html", wxSize(900, 500)); }
+ CalibrationFlowDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create("/calibration/filament_flow","filament_flow.html", wxSize(900, 500)); }
virtual ~CalibrationFlowDialog() {}
protected:
diff --git a/src/slic3r/GUI/CalibrationOverBridgeDialog.hpp b/src/slic3r/GUI/CalibrationOverBridgeDialog.hpp
index 2d1b2a3d0..c9f5a6ab2 100644
--- a/src/slic3r/GUI/CalibrationOverBridgeDialog.hpp
+++ b/src/slic3r/GUI/CalibrationOverBridgeDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationOverBridgeDialog : public CalibrationAbstractDialog
{
public:
- CalibrationOverBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Ironing pattern calibration") { create("/calibration/over-bridge_tuning/over-bridge_tuning.html", wxSize(900, 500)); }
+ CalibrationOverBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Ironing pattern calibration") { create("/calibration/over-bridge_tuning", "over-bridge_tuning.html", wxSize(900, 500)); }
virtual ~CalibrationOverBridgeDialog() { }
protected:
diff --git a/src/slic3r/GUI/CalibrationRetractionDialog.hpp b/src/slic3r/GUI/CalibrationRetractionDialog.hpp
index 1e481eb89..1cecb4dcd 100644
--- a/src/slic3r/GUI/CalibrationRetractionDialog.hpp
+++ b/src/slic3r/GUI/CalibrationRetractionDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationRetractionDialog : public CalibrationAbstractDialog
{
public:
- CalibrationRetractionDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create("/calibration/retraction/retraction.html", wxSize(900, 500)); }
+ CalibrationRetractionDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Flow calibration") { create("/calibration/retraction", "retraction.html", wxSize(900, 500)); }
virtual ~CalibrationRetractionDialog() {}
protected:
diff --git a/src/slic3r/GUI/CalibrationTempDialog.hpp b/src/slic3r/GUI/CalibrationTempDialog.hpp
index 0556a277e..e9650929f 100644
--- a/src/slic3r/GUI/CalibrationTempDialog.hpp
+++ b/src/slic3r/GUI/CalibrationTempDialog.hpp
@@ -10,7 +10,7 @@ class CalibrationTempDialog : public CalibrationAbstractDialog
{
public:
- CalibrationTempDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Temperature calibration") { create("/calibration/filament_temp/filament_temp.html"); }
+ CalibrationTempDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Temperature calibration") { create("/calibration/filament_temp", "filament_temp.html"); }
virtual ~CalibrationTempDialog(){ }
protected:
diff --git a/src/slic3r/GUI/ConfigSnapshotDialog.cpp b/src/slic3r/GUI/ConfigSnapshotDialog.cpp
index af17bae74..3137bbd7c 100644
--- a/src/slic3r/GUI/ConfigSnapshotDialog.cpp
+++ b/src/slic3r/GUI/ConfigSnapshotDialog.cpp
@@ -48,28 +48,28 @@ static wxString generate_html_row(const Config::Snapshot &snapshot, bool row_eve
text += " (" + wxString::FromUTF8(snapshot.comment.data()) + ")";
text += "</b></font><br>";
// End of row header.
- text += _(L(SLIC3R_APP_NAME " version")) + ": " + snapshot.slic3r_version_captured.to_string() + "<br>";
+ text += wxString::Format( _L( "%s version"), SLIC3R_APP_NAME) + ": " + snapshot.slic3r_version_captured.to_string() + "<br>";
bool has_fff = ! snapshot.print.empty() || ! snapshot.filaments.empty();
bool has_sla = ! snapshot.sla_print.empty() || ! snapshot.sla_material.empty();
if (has_fff || ! has_sla) {
- text += _(L("print")) + ": " + snapshot.print + "<br>";
- text += _(L("filaments")) + ": " + snapshot.filaments.front() + "<br>";
+ text += _L("print") + ": " + snapshot.print + "<br>";
+ text += _L("filaments") + ": " + snapshot.filaments.front() + "<br>";
}
if (has_sla) {
- text += _(L("SLA print")) + ": " + snapshot.sla_print + "<br>";
- text += _(L("SLA material")) + ": " + snapshot.sla_material + "<br>";
+ text += _L("SLA print") + ": " + snapshot.sla_print + "<br>";
+ text += _L("SLA material") + ": " + snapshot.sla_material + "<br>";
}
text += _(L("printer")) + ": " + (snapshot.physical_printer.empty() ? snapshot.printer : snapshot.physical_printer) + "<br>";
bool compatible = true;
for (const Config::Snapshot::VendorConfig &vc : snapshot.vendor_configs) {
- text += _(L("vendor")) + ": " + vc.name +", " + _(L("version")) + ": " + vc.version.config_version.to_string() +
- ", " + _(L("min " SLIC3R_APP_NAME " version")) + ": " + vc.version.min_slic3r_version.to_string();
+ text += _L("vendor") + ": " + vc.name +", " + _L("version") + ": " + vc.version.config_version.to_string() +
+ ", " + wxString::Format(_L("min %s version"), SLIC3R_APP_NAME) + ": " + vc.version.min_slic3r_version.to_string();
if (vc.version.max_slic3r_version != Semver::inf())
- text += ", " + _(L("max " SLIC3R_APP_NAME " version")) + ": " + vc.version.max_slic3r_version.to_string();
+ text += ", " + wxString::Format(_L("max %s version"), SLIC3R_APP_NAME) + ": " + vc.version.max_slic3r_version.to_string();
text += "<br>";
for (const std::pair<std::string, std::set<std::string>> &model : vc.models_variants_installed) {
- text += _(L("model")) + ": " + model.first + ", " + _(L("variants")) + ": ";
+ text += _L("model") + ": " + model.first + ", " + _L("variants") + ": ";
for (const std::string &variant : model.second) {
if (&variant != &*model.second.begin())
text += ", ";
@@ -81,10 +81,10 @@ static wxString generate_html_row(const Config::Snapshot &snapshot, bool row_eve
}
if (! compatible) {
- text += "<p align=\"right\">" + from_u8((boost::format(_utf8(L("Incompatible with this %s"))) % SLIC3R_APP_NAME).str()) + "</p>";
+ text += "<p align=\"right\">" + wxString::Format(_L("Incompatible with this %s"), SLIC3R_APP_NAME) + "</p>";
}
else if (! snapshot_active)
- text += "<p align=\"right\"><a href=\"" + snapshot.id + "\">" + _(L("Activate")) + "</a></p>";
+ text += "<p align=\"right\"><a href=\"" + snapshot.id + "\">" + _L("Activate") + "</a></p>";
text += "</td>";
text += "</tr>";
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 &params)
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<TabPrinter*>(this)) == nullptr) continue;
- wxString description_line_text = _L(""
+ wxString description_line_text = wxString::Format(_L(""
"Note: All parameters from this group are moved to the Physical Printer settings (see changelog).\n\n"
"A new Physical Printer profile is created by clicking on the \"cog\" icon right of the Printer profiles combo box, "
"by selecting the \"Add physical printer\" item in the Printer combo box. The Physical Printer profile editor opens "
"also when clicking on the \"cog\" icon in the Printer settings tab. The Physical Printer profiles are being stored "
- "into " SLIC3R_APP_NAME "/physical_printer directory.");
+ "into %s/physical_printer directory."), SLIC3R_APP_KEY);
current_line = { "", "" };
current_line.full_width = 1;