i18n: wrap hardcoded GUI strings (undo/redo labels, dialogs, notifications) + FR (#14729)

This commit is contained in:
foXaCe
2026-07-13 17:19:33 +02:00
committed by GitHub
parent 88262ee504
commit c41e685a69
19 changed files with 196 additions and 67 deletions

View File

@@ -1154,7 +1154,7 @@ void ObjectList::update_filament_in_config(const wxDataViewItem& item)
m_config = config;
take_snapshot("Change Filament");
take_snapshot(_u8L("Change Filament"));
const int extruder = m_objects_model->GetExtruderNumber(item);
m_config->set_key_value("extruder", new ConfigOptionInt(extruder));
@@ -1192,7 +1192,7 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const
if (obj_idx < 0) return;
const int volume_id = m_objects_model->GetVolumeIdByItem(item);
take_snapshot(volume_id < 0 ? "Rename Object" : "Rename Part");
take_snapshot(volume_id < 0 ? _u8L("Rename Object") : _u8L("Rename Part"));
ModelObject* obj = object(obj_idx);
if (m_objects_model->GetItemType(item) & itObject) {
@@ -1360,7 +1360,7 @@ void ObjectList::paste_settings_into_list()
{
wxDataViewItemArray sels;
GetSelections(sels);
take_snapshot("Paste settings");
take_snapshot(_u8L("Paste settings"));
std::unique_ptr<t_config_option_keys> global_keys; // need copy from global
@@ -1578,7 +1578,7 @@ void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_me
int obj_idx, vol_idx;
get_selected_item_indexes(obj_idx, vol_idx, item);
if (obj_idx != -1) {
Plater::TakeSnapshot(plater, "Shift objects to bed");
Plater::TakeSnapshot(plater, _u8L("Shift objects to bed"));
(*m_objects)[obj_idx]->ensure_on_bed();
cnv->reload_scene(true, true);
update_info_items(obj_idx);
@@ -2001,7 +2001,7 @@ void ObjectList::OnDrop(wxDataViewEvent &event)
}
//#if 1
take_snapshot("Object order changed");
take_snapshot(_u8L("Object order changed"));
if(m_dragged_data.type() & itObject){
int delta = dest_obj_id < src_obj_id ? -1 : 1;
@@ -2065,9 +2065,9 @@ void ObjectList::add_category_to_settings_from_selection(const std::vector< std:
assert(m_config);
auto opt_keys = m_config->keys();
const std::string snapshot_text = item_type & itLayer ? "Layer setting added" :
item_type & itVolume ? "Part setting added" :
"Object setting added";
const std::string snapshot_text = item_type & itLayer ? _u8L("Layer setting added") :
item_type & itVolume ? _u8L("Part setting added") :
_u8L("Object setting added");
take_snapshot(snapshot_text);
const DynamicPrintConfig& from_config = printer_technology() == ptFFF ?
@@ -2106,9 +2106,9 @@ void ObjectList::add_category_to_settings_from_frequent(const std::vector<std::s
assert(m_config);
auto opt_keys = m_config->keys();
const std::string snapshot_text = item_type & itLayer ? "Height range settings added" :
item_type & itVolume ? "Part settings added" :
"Object settings added";
const std::string snapshot_text = item_type & itLayer ? _u8L("Height range settings added") :
item_type & itVolume ? _u8L("Part settings added") :
_u8L("Object settings added");
take_snapshot(snapshot_text);
const DynamicPrintConfig& from_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
@@ -2176,7 +2176,7 @@ void ObjectList::load_subobject(ModelVolumeType type, bool from_galery/* = false
if (input_files.IsEmpty())
return;
take_snapshot((type == ModelVolumeType::MODEL_PART) ? "Load Part" : "Load Modifier");
take_snapshot((type == ModelVolumeType::MODEL_PART) ? _u8L("Load Part") : _u8L("Load Modifier"));
std::vector<ModelVolume*> volumes;
// ! ysFIXME - delete commented code after testing and rename "load_modifier" to something common
@@ -2463,7 +2463,7 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode
if (instance_idx == -1)
return;
take_snapshot("Add primitive");
take_snapshot(_u8L("Add primitive"));
// Selected object
ModelObject &model_object = *(*m_objects)[obj_idx];
@@ -2555,7 +2555,7 @@ void ObjectList::load_shape_object(const std::string &type_name)
if (obj_idx < 0)
return;
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Add Primitive");
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _u8L("Add Primitive"));
// Create mesh
BoundingBoxf3 bb;
@@ -2716,7 +2716,7 @@ void ObjectList::del_settings_from_config(const wxDataViewItem& parent_item)
(is_layer_settings && opt_cnt == 2 && m_config->has("extruder") && m_config->has("layer_height")))
return;
take_snapshot("Delete Settings");
take_snapshot(_u8L("Delete Settings"));
int extruder = m_config->has("extruder") ? m_config->extruder() : -1;
@@ -2757,7 +2757,7 @@ void ObjectList::del_layer_from_object(const int obj_idx, const t_layer_height_r
if (del_range == object(obj_idx)->layer_config_ranges.end())
return;
take_snapshot("Remove height range");
take_snapshot(_u8L("Remove height range"));
object(obj_idx)->layer_config_ranges.erase(del_range);
@@ -2830,7 +2830,7 @@ bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, con
return false;
}
take_snapshot("Delete part");
take_snapshot(_u8L("Delete part"));
object->delete_volume(idx);
@@ -2895,7 +2895,7 @@ void ObjectList::split()
return;
}
take_snapshot("Split to parts");
take_snapshot(_u8L("Split to parts"));
volume->split(filament_cnt, wxGetApp().app_config->get_bool("keep_painting"));
@@ -3028,7 +3028,7 @@ void ObjectList::merge(bool to_multipart_object)
GetSelections(sels);
assert(!sels.IsEmpty());
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Assemble");
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _u8L("Assemble"));
get_object_idxs(obj_idxs, sels);
@@ -3176,7 +3176,7 @@ void ObjectList::merge(bool to_multipart_object)
if (obj_idx == -1)
return;
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Merge parts to an object");
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _u8L("Merge parts to an object"));
ModelObject* model_object = (*m_objects)[obj_idx];
model_object->merge();
@@ -3243,7 +3243,7 @@ void ObjectList::layers_editing()
// set some default value
if (ranges.empty()) {
// BBS: remove snapshot name "Add layers"
take_snapshot("Add layers");
take_snapshot(_u8L("Add layers"));
ranges[{ 0.0f, 2.0f }].assign_config(get_default_layer_config(obj_idx));
}
@@ -4234,7 +4234,7 @@ void ObjectList::delete_from_model_and_list(const ItemType type, const int obj_i
if (!(type&(itObject|itVolume|itInstance)))
return;
take_snapshot("Delete selected");
take_snapshot(_u8L("Delete selected"));
if (type&itObject) {
bool was_cut = object(obj_idx)->is_cut();
@@ -4467,7 +4467,7 @@ void ObjectList::remove()
UnselectAll();
update_selection(sels, sels_mode, m_objects_model);
Plater::TakeSnapshot snapshot = Plater::TakeSnapshot(wxGetApp().plater(), "Delete selected");
Plater::TakeSnapshot snapshot = Plater::TakeSnapshot(wxGetApp().plater(), _u8L("Delete selected"));
for (auto& item : sels)
{
@@ -5525,7 +5525,7 @@ void ObjectList::change_part_type()
return;
}
take_snapshot("Change part type");
take_snapshot(_u8L("Change part type"));
volume->set_type(new_type);
wxDataViewItemArray sel = reorder_volumes_and_get_selection(obj_idx, [volume](const ModelVolume* vol) { return vol == volume; });
@@ -5799,7 +5799,7 @@ void ObjectList::set_volume_type(ModelVolumeType new_type)
}
}
take_snapshot("Change part type");
take_snapshot(_u8L("Change part type"));
std::set<const ModelVolume*> changed_volumes;
std::set<int> touched_objects;
@@ -6033,7 +6033,7 @@ void ObjectList::split_instances()
if (obj_idx == -1)
return;
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Instances to Separated Objects");
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _u8L("Instances to Separated Objects"));
if (selection.is_single_full_object())
{
@@ -6164,7 +6164,7 @@ void ObjectList::fix_through_cgal()
return true;
};
Plater::TakeSnapshot snapshot(plater, "Repairing model object");
Plater::TakeSnapshot snapshot(plater, _u8L("Repairing model object"));
// Open a progress dialog.
ProgressDialog progress_dlg(_L("Repairing model object"), "", 100, find_toplevel_parent(plater),
@@ -6495,7 +6495,7 @@ void ObjectList::OnEditingStarted(wxDataViewEvent &event)
else if (col == colSinking) {
Plater * plater = wxGetApp().plater();
GLCanvas3D *cnv = plater->canvas3D();
Plater::TakeSnapshot(plater, "Shift objects to bed");
Plater::TakeSnapshot(plater, _u8L("Shift objects to bed"));
int obj_idx, vol_idx;
get_selected_item_indexes(obj_idx, vol_idx, item);
(*m_objects)[obj_idx]->ensure_on_bed();
@@ -6582,7 +6582,7 @@ void ObjectList::set_extruder_for_selected_items(const int extruder)
if (sels.empty())
return;
take_snapshot("Change Filaments");
take_snapshot(_u8L("Change Filaments"));
for (const wxDataViewItem& sel_item : sels)
{