ENH:translate text

jira: none
Change-Id: I0bbacfc198b93f663d1e844664440e45cf39617d
(cherry picked from commit 248f6daf96591010654263d57c14bf45fef2a53b)
This commit is contained in:
zhou.xu
2025-01-19 13:59:43 +08:00
committed by Noisyfox
parent efb32b7c54
commit 49743635f5
5 changed files with 30 additions and 26 deletions

View File

@@ -1637,7 +1637,7 @@ Sidebar::Sidebar(Plater *parent)
wxBoxSizer* bSizer39; wxBoxSizer* bSizer39;
bSizer39 = new wxBoxSizer( wxHORIZONTAL ); bSizer39 = new wxBoxSizer( wxHORIZONTAL );
p->m_filament_icon = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "filament"); p->m_filament_icon = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "filament");
p->m_staticText_filament_settings = new Label(p->m_panel_filament_title, _L("Filaments"), LB_PROPAGATE_MOUSE_EVENT); p->m_staticText_filament_settings = new Label(p->m_panel_filament_title, _CTX(L_CONTEXT("Filaments", "SideBar"), "SideBar"), LB_PROPAGATE_MOUSE_EVENT);
bSizer39->Add(p->m_filament_icon, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::TitlebarMargin())); bSizer39->Add(p->m_filament_icon, 0, wxALIGN_CENTER | wxLEFT, FromDIP(SidebarProps::TitlebarMargin()));
bSizer39->AddSpacer(FromDIP(SidebarProps::ElementSpacing())); bSizer39->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
bSizer39->Add( p->m_staticText_filament_settings, 0, wxALIGN_CENTER ); bSizer39->Add( p->m_staticText_filament_settings, 0, wxALIGN_CENTER );

View File

@@ -1864,7 +1864,7 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
msg_text = _L("When enable spiral vase mode, machines with I3 structure will not generate timelapse videos."); msg_text = _L("When enable spiral vase mode, machines with I3 structure will not generate timelapse videos.");
} }
else if (warning.error_code == "1001C002") { else if (warning.error_code == "1001C002") {
msg_text = _L("Timelapse is not supported because Print sequence is set to \"By object\"."); msg_text = _L("The current printer does not support timelapse in Traditional Mode when printing By-Object.");
} }
} }
} }

View File

@@ -16,6 +16,7 @@
#include "Jobs/BoostThreadWorker.hpp" #include "Jobs/BoostThreadWorker.hpp"
#include "Jobs/PlaterWorker.hpp" #include "Jobs/PlaterWorker.hpp"
#include <chrono> #include <chrono>
#include "Widgets/Label.hpp"
#include "Widgets/Button.hpp" #include "Widgets/Button.hpp"
#include "Widgets/CheckBox.hpp" #include "Widgets/CheckBox.hpp"
#include "CapsuleButton.hpp" #include "CapsuleButton.hpp"
@@ -24,7 +25,7 @@ using namespace Slic3r::GUI;
#define BUTTON_SIZE wxSize(FromDIP(58), FromDIP(24)) #define BUTTON_SIZE wxSize(FromDIP(58), FromDIP(24))
#define SyncAmsInfoDialogWidth FromDIP(675) #define SyncAmsInfoDialogWidth FromDIP(675)
#define SyncLabelWidth FromDIP(640)
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
wxDEFINE_EVENT(EVT_CLEAR_IPADDRESS, wxCommandEvent); wxDEFINE_EVENT(EVT_CLEAR_IPADDRESS, wxCommandEvent);
wxDEFINE_EVENT(EVT_UPDATE_USER_MACHINE_LIST, wxCommandEvent); wxDEFINE_EVENT(EVT_UPDATE_USER_MACHINE_LIST, wxCommandEvent);
@@ -105,14 +106,9 @@ bool SyncAmsInfoDialog::Show(bool show)
m_button_cancel->Hide(); m_button_cancel->Hide();
m_confirm_title->Show(); m_confirm_title->Show();
m_confirm_title->SetLabel(_L("Printer not connected. Please connect or choose a printer on the Device page and try again.")); m_confirm_title->SetLabel(_L("Printer not connected. Please connect or choose a printer on the Device page and try again."));
SetMinSize(wxSize(FromDIP(700), -1));
SetMaxSize(wxSize(FromDIP(700), -1));
// m_confirm_title->SetForegroundColour(wxColour(250, 10, 10, 255));
} else if (dirty_filament) { } else if (dirty_filament) {
m_confirm_title->Show(); m_confirm_title->Show();
m_confirm_title->SetLabel(_L("Synchronizing AMS filaments will discard your modified but unsaved filament presets.\nAre you sure you want to continue?")); m_confirm_title->SetLabel(_L("Synchronizing AMS filaments will discard your modified but unsaved filament presets.\nAre you sure you want to continue?"));
SetMinSize(wxSize(FromDIP(700), -1));
SetMaxSize(wxSize(FromDIP(700), -1));
} else if (!m_check_dirty_fialment) { } else if (!m_check_dirty_fialment) {
show_color_panel(true); show_color_panel(true);
m_filament_left_panel->Show(false); // empty_project m_filament_left_panel->Show(false); // empty_project
@@ -121,10 +117,10 @@ bool SyncAmsInfoDialog::Show(bool show)
if (m_mode_combox_sizer) { if (m_mode_combox_sizer) {
m_mode_combox_sizer->Show(true); m_mode_combox_sizer->Show(true);
} }
m_confirm_title->SetLabel(_L("After sync, all currently configured filament presets and colors will be discarded.")); m_confirm_title->SetLabel(m_undone_str);
SetMinSize(wxSize(SyncAmsInfoDialogWidth, -1));
SetMaxSize(wxSize(SyncAmsInfoDialogWidth, -1));
} }
Layout(); Layout();
Fit(); Fit();
CenterOnParent(); CenterOnParent();
@@ -378,12 +374,15 @@ void SyncAmsInfoDialog::update_when_change_map_mode(int idx)
{ {
m_map_mode = (MapModeEnum) idx; m_map_mode = (MapModeEnum) idx;
if (m_map_mode == MapModeEnum::ColorMap) { if (m_map_mode == MapModeEnum::ColorMap) {
m_are_you_sure_title->SetLabel(_L("Are you sure to synchronize the filaments?"));
show_color_panel(true); show_color_panel(true);
m_confirm_title->SetLabel(m_undone_str);
} else if (m_map_mode == MapModeEnum::Override) { } else if (m_map_mode == MapModeEnum::Override) {
m_are_you_sure_title->SetLabel(_L("Are you sure to directly override current filaments?"));
show_color_panel(false); show_color_panel(false);
m_confirm_title->Show();
m_confirm_title->SetLabel(m_override_undone_str);
} }
Layout();
Fit();
} }
void SyncAmsInfoDialog::update_when_change_map_mode(wxCommandEvent &e) void SyncAmsInfoDialog::update_when_change_map_mode(wxCommandEvent &e)
@@ -432,6 +431,7 @@ void SyncAmsInfoDialog::show_color_panel(bool flag, bool update_layout)
update_more_setting(); update_more_setting();
} }
m_confirm_title->Show(flag); m_confirm_title->Show(flag);
m_are_you_sure_title->Show(flag);
if (flag) { if (flag) {
auto extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders(); auto extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders();
/*if (wxGetApp().plater()->get_extruders_colors().size() != extruders.size()) { /*if (wxGetApp().plater()->get_extruders_colors().size() != extruders.size()) {
@@ -623,8 +623,7 @@ void SyncAmsInfoDialog::updata_ui_when_priner_not_same() {
m_button_ok->SetLabel(_L("OK")); m_button_ok->SetLabel(_L("OK"));
m_confirm_title->Show(); m_confirm_title->Show();
m_confirm_title->SetLabel(_L("The connected printer does not match the currently selected printer. Please change the selected printer.")); m_confirm_title->SetLabel(_L("The connected printer does not match the currently selected printer. Please change the selected printer."));
SetMinSize(wxSize(FromDIP(800), -1));
SetMaxSize(wxSize(FromDIP(800), -1));
Layout(); Layout();
Fit(); Fit();
} }
@@ -1293,11 +1292,13 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
bSizer->Add(more_setting_sizer, 0, wxEXPAND | wxLEFT, FromDIP(25)); bSizer->Add(more_setting_sizer, 0, wxEXPAND | wxLEFT, FromDIP(25));
wxBoxSizer *confirm_boxsizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *confirm_boxsizer = new wxBoxSizer(wxVERTICAL);
m_confirm_title = new wxStaticText(this, wxID_ANY, _L("After sync, all currently configured filament presets and colors will be discarded."),
wxDefaultPosition, wxDefaultSize); m_override_undone_str = _L("The project's filament list will be directly replaced with the information of all filaments from the printer. This action cannot be undone.");
//m_confirm_title->Wrap(FromDIP(SyncAmsInfoDialogWidth - 50)); m_undone_str = _L("After being synced, the project's filament presets and colors will be replaced with the mapped filament types and colors. This action cannot be undone.");
//m_confirm_title->SetFont(Label::Head_14); m_confirm_title = new Label(this, m_undone_str, LB_AUTO_WRAP);
confirm_boxsizer->Add(m_confirm_title, 0, wxALIGN_LEFT | wxTOP | wxRIGHT, FromDIP(10)); m_confirm_title->SetMinSize(wxSize(SyncLabelWidth, -1));
m_confirm_title->SetMaxSize(wxSize(SyncLabelWidth, -1));
confirm_boxsizer->Add(m_confirm_title, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxTOP, FromDIP(10));
m_are_you_sure_title = new wxStaticText(this, wxID_ANY,_L("Are you sure to synchronize the filaments?")); m_are_you_sure_title = new wxStaticText(this, wxID_ANY,_L("Are you sure to synchronize the filaments?"));
//m_are_you_sure_title->SetFont(Label::Head_14); //m_are_you_sure_title->SetFont(Label::Head_14);
confirm_boxsizer->Add(m_are_you_sure_title, 0, wxALIGN_LEFT | wxTOP, FromDIP(0)); confirm_boxsizer->Add(m_are_you_sure_title, 0, wxALIGN_LEFT | wxTOP, FromDIP(0));
@@ -4377,7 +4378,7 @@ SyncNozzleAndAmsDialog::SyncNozzleAndAmsDialog(wxWindow *parent, InputInfo &inpu
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal)); std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(23, 25, 22), StateColor::Pressed), std::pair<wxColour, int>(wxColour(43, 45, 42), StateColor::Hovered), StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(23, 25, 22), StateColor::Pressed), std::pair<wxColour, int>(wxColour(43, 45, 42), StateColor::Hovered),
std::pair<wxColour, int>(wxColour(23, 25, 22), StateColor::Normal)); std::pair<wxColour, int>(wxColour(23, 25, 22), StateColor::Normal));
m_button_ok = new Button(this, m_input_info.only_external_material ? _L("Sync filament") : _L("Sync AMS filament")); m_button_ok = new Button(this, _L("Continue to sync filaments"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderWidth(0); m_button_ok->SetBorderWidth(0);
m_button_ok->SetTextColor(wxColour(0xFEFEFE)); m_button_ok->SetTextColor(wxColour(0xFEFEFE));

View File

@@ -11,6 +11,7 @@
#include "DeviceManager.hpp" #include "DeviceManager.hpp"
class Button; class Button;
class CheckBox; class CheckBox;
class Label;
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
class CapsuleButton; class CapsuleButton;
class SyncAmsInfoDialog : public DPIDialog class SyncAmsInfoDialog : public DPIDialog
@@ -312,7 +313,9 @@ private:
wxBoxSizer * sizer_basic_right_info = nullptr; wxBoxSizer * sizer_basic_right_info = nullptr;
wxBoxSizer * sizer_advanced_options_title = nullptr; wxBoxSizer * sizer_advanced_options_title = nullptr;
wxPanel * m_rename_edit_panel = nullptr; wxPanel * m_rename_edit_panel = nullptr;
wxStaticText * m_confirm_title = nullptr; Label * m_confirm_title = nullptr;
wxString m_undone_str;
wxString m_override_undone_str;
wxStaticText * m_are_you_sure_title = nullptr; wxStaticText * m_are_you_sure_title = nullptr;
// wxBoxSizer * m_plate_combox_sizer = nullptr; // wxBoxSizer * m_plate_combox_sizer = nullptr;

View File

@@ -1595,7 +1595,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure"); auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
if ((printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) if ((printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3)
|| m_preset_bundle->get_printer_extruder_count() == 2) { || m_preset_bundle->get_printer_extruder_count() == 2) {
wxString msg_text = _(L("Timelapse is not supported because Print sequence is set to \"By object\".")); wxString msg_text = _(L("The current printer does not support timelapse in Traditional Mode when printing By-Object."));
msg_text += "\n\n" + _(L("Still print by object?")); msg_text += "\n\n" + _(L("Still print by object?"));
MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO); MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO);