From 394d02fdd930edb0840265867bfe5cc3c050e0f2 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 10 May 2019 12:54:20 +0200 Subject: [PATCH 1/2] Localized "default" extruder --- src/slic3r/GUI/GUI_ObjectList.cpp | 12 ++++++------ src/slic3r/GUI/wxExtensions.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 14a0d9142..113c34fde 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -354,7 +354,7 @@ DynamicPrintConfig& ObjectList::get_item_config(const wxDataViewItem& item) cons wxDataViewColumn* ObjectList::create_objects_list_extruder_column(int extruders_count) { wxArrayString choices; - choices.Add("default"); + choices.Add(_(L("default"))); for (int i = 1; i <= extruders_count; ++i) choices.Add(wxString::Format("%d", i)); wxDataViewChoiceRenderer *c = @@ -375,7 +375,7 @@ void ObjectList::update_extruder_values_for_items(const int max_extruder) wxString extruder; if (!object->config.has("extruder") || object->config.option("extruder")->value > max_extruder) - extruder = "default"; + extruder = _(L("default")); else extruder = wxString::Format("%d", object->config.option("extruder")->value); @@ -387,7 +387,7 @@ void ObjectList::update_extruder_values_for_items(const int max_extruder) if (!item) continue; if (!object->volumes[id]->config.has("extruder") || object->volumes[id]->config.option("extruder")->value > max_extruder) - extruder = "default"; + extruder = _(L("default")); else extruder = wxString::Format("%d", object->volumes[id]->config.option("extruder")->value); @@ -2852,7 +2852,7 @@ void ObjectList::show_multi_selection_menu() void ObjectList::extruder_selection() { wxArrayString choices; - choices.Add("default"); + choices.Add(_(L("default"))); for (int i = 1; i <= extruders_count(); ++i) choices.Add(wxString::Format("%d", i)); @@ -2862,7 +2862,7 @@ void ObjectList::extruder_selection() if (selected_extruder.IsEmpty()) return; - const int extruder_num = selected_extruder == "default" ? 0 : atoi(selected_extruder.c_str()); + const int extruder_num = selected_extruder == _(L("default")) ? 0 : atoi(selected_extruder.c_str()); // /* Another variant for an extruder selection */ // extruder_num = wxGetNumberFromUser(_(L("Attention!!! \n" @@ -2894,7 +2894,7 @@ void ObjectList::set_extruder_for_selected_items(const int extruder) const else if (extruder > 0) config.set_key_value("extruder", new ConfigOptionInt(extruder)); - const wxString extruder_str = extruder == 0 ? wxString ("default") : + const wxString extruder_str = extruder == 0 ? wxString (_(L("default"))) : wxString::Format("%d", config.option("extruder")->value); auto const type = m_objects_model->GetItemType(item); diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 21e8c348d..3affba22b 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -496,7 +496,7 @@ wxDataViewItem ObjectDataViewModel::Add(const wxString &name, const int extruder, const bool has_errors/* = false*/) { - const wxString extruder_str = extruder == 0 ? "default" : wxString::Format("%d", extruder); + const wxString extruder_str = extruder == 0 ? _(L("default")) : wxString::Format("%d", extruder); auto root = new ObjectDataViewModelNode(name, extruder_str); // Add error icon if detected auto-repaire if (has_errors) @@ -521,7 +521,7 @@ wxDataViewItem ObjectDataViewModel::AddVolumeChild( const wxDataViewItem &parent ObjectDataViewModelNode *root = (ObjectDataViewModelNode*)parent_item.GetID(); if (!root) return wxDataViewItem(0); - wxString extruder_str = extruder == 0 ? "default" : wxString::Format("%d", extruder); + wxString extruder_str = extruder == 0 ? _(L("default")) : wxString::Format("%d", extruder); // because of istance_root is a last item of the object int insert_position = root->GetChildCount() - 1; From c37ec5bc9ec060d1f9836c23dcc6b94eaa9176e2 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 10 May 2019 13:26:20 +0200 Subject: [PATCH 2/2] New POT-file --- resources/localization/Slic3rPE.pot | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/localization/Slic3rPE.pot b/resources/localization/Slic3rPE.pot index b0852567f..d1a26c5b6 100644 --- a/resources/localization/Slic3rPE.pot +++ b/resources/localization/Slic3rPE.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-05-10 11:50+0200\n" +"POT-Creation-Date: 2019-05-10 13:25+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1329,6 +1329,14 @@ msgstr "" msgid "Right button click the icon to change the object settings" msgstr "" +#: src/slic3r/GUI/GUI_ObjectList.cpp:357 src/slic3r/GUI/GUI_ObjectList.cpp:378 +#: src/slic3r/GUI/GUI_ObjectList.cpp:390 src/slic3r/GUI/GUI_ObjectList.cpp:2855 +#: src/slic3r/GUI/GUI_ObjectList.cpp:2865 +#: src/slic3r/GUI/GUI_ObjectList.cpp:2897 src/slic3r/GUI/wxExtensions.cpp:499 +#: src/slic3r/GUI/wxExtensions.cpp:524 +msgid "default" +msgstr "" + #: src/slic3r/GUI/GUI_ObjectList.cpp:362 src/slic3r/GUI/Tab.cpp:1480 #: src/libslic3r/PrintConfig.cpp:456 msgid "Extruder"