mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Localization: Added plural form for some phrases, updated POT
This commit is contained in:
		
							parent
							
								
									6846ba0b59
								
							
						
					
					
						commit
						0baa92fab8
					
				
					 7 changed files with 2017 additions and 1878 deletions
				
			
		|  | @ -1813,7 +1813,8 @@ bool GUI_App::check_unsaved_changes(const wxString &header) | |||
|             // synchronize config.ini with the current selections.
 | ||||
|             preset_bundle->export_selections(*app_config); | ||||
| 
 | ||||
|             wxMessageBox(_L("The preset(s) modifications are successfully saved")); | ||||
|             wxMessageBox(_L_PLURAL("The preset modifications are successfully saved",  | ||||
|                                    "The presets modifications are successfully saved", dlg.get_names_and_types().size())); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -413,27 +413,27 @@ wxString ObjectList::get_mesh_errors_list(const int obj_idx, const int vol_idx / | |||
|         return ""; // hide tooltip
 | ||||
| 
 | ||||
|     // Create tooltip string, if there are errors 
 | ||||
|     wxString tooltip = wxString::Format(_(L("Auto-repaired (%d errors):")), errors) + "\n"; | ||||
|     wxString tooltip = format_wxstr(_L_PLURAL("Auto-repaired %1$d error", "Auto-repaired %1$d errors", errors), errors) + ":\n"; | ||||
| 
 | ||||
|     const stl_stats& stats = vol_idx == -1 ? | ||||
|                             (*m_objects)[obj_idx]->get_object_stl_stats() : | ||||
|                             (*m_objects)[obj_idx]->volumes[vol_idx]->mesh().stl.stats; | ||||
| 
 | ||||
|     std::map<std::string, int> error_msg = { | ||||
|         { L("degenerate facets"),   stats.degenerate_facets }, | ||||
|         { L("edges fixed"),         stats.edges_fixed       }, | ||||
|         { L("facets removed"),      stats.facets_removed    }, | ||||
|         { L("facets added"),        stats.facets_added      }, | ||||
|         { L("facets reversed"),     stats.facets_reversed   }, | ||||
|         { L("backwards edges"),     stats.backwards_edges   } | ||||
|     }; | ||||
| 
 | ||||
|     for (const auto& error : error_msg) | ||||
|         if (error.second > 0) | ||||
|             tooltip += from_u8((boost::format("\t%1% %2%\n") % error.second % _utf8(error.first)).str()); | ||||
|     if (stats.degenerate_facets > 0) | ||||
|         tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d degenerate facet", "%1$d degenerate facets", stats.degenerate_facets), stats.degenerate_facets) + "\n"; | ||||
|     if (stats.edges_fixed > 0) | ||||
|         tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d edge fixed", "%1$d edges fixed", stats.edges_fixed), stats.edges_fixed) + "\n"; | ||||
|     if (stats.facets_removed > 0) | ||||
|         tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet removed", "%1$d facets removed", stats.facets_removed), stats.facets_removed) + "\n"; | ||||
|     if (stats.facets_added > 0) | ||||
|         tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet added", "%1$d facets added", stats.facets_added), stats.facets_added) + "\n"; | ||||
|     if (stats.facets_reversed > 0) | ||||
|         tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet reversed", "%1$d facets reversed", stats.facets_reversed), stats.facets_reversed) + "\n"; | ||||
|     if (stats.backwards_edges > 0) | ||||
|         tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d backwards edge", "%1$d backwards edges", stats.backwards_edges), stats.backwards_edges) + "\n"; | ||||
| 
 | ||||
|     if (is_windows10()) | ||||
|         tooltip += _(L("Right button click the icon to fix STL through Netfabb")); | ||||
|         tooltip += _L("Right button click the icon to fix STL through Netfabb"); | ||||
| 
 | ||||
|     return tooltip; | ||||
| } | ||||
|  |  | |||
|  | @ -572,12 +572,17 @@ void PhysicalPrinterDialog::OnOK(wxEvent& event) | |||
|     if (!repeat_presets.empty()) | ||||
|     { | ||||
|         wxString repeatable_presets = "\n"; | ||||
|         for (const std::string& preset_name : repeat_presets) | ||||
|         int repeat_cnt = 0; | ||||
|         for (const std::string& preset_name : repeat_presets) { | ||||
|             repeatable_presets += "    " + from_u8(preset_name) + "\n"; | ||||
|             repeat_cnt++; | ||||
|         } | ||||
|         repeatable_presets += "\n"; | ||||
| 
 | ||||
|         wxString msg_text = from_u8((boost::format(_u8L("Following printer preset(s) is duplicated:%1%" | ||||
|                                                         "The above preset for printer \"%2%\" will be used just once.")) % repeatable_presets % printer_name).str()); | ||||
|         wxString msg_text = format_wxstr(_L_PLURAL("Following printer preset is duplicated:%1%" | ||||
|                                                    "The above preset for printer \"%2%\" will be used just once.", | ||||
|                                                    "Following printer presets are duplicated:%1%" | ||||
|                                                    "The above presets for printer \"%2%\" will be used just once.", repeat_cnt), repeatable_presets, printer_name); | ||||
|         wxMessageDialog dialog(nullptr, msg_text, _L("Warning"), wxICON_WARNING | wxOK | wxCANCEL); | ||||
|         if (dialog.ShowModal() == wxID_CANCEL) | ||||
|             return; | ||||
|  |  | |||
|  | @ -1065,18 +1065,29 @@ void Sidebar::show_info_sizer() | |||
| 
 | ||||
|     const auto& stats = model_object->get_object_stl_stats();//model_object->volumes.front()->mesh.stl.stats;
 | ||||
|     p->object_info->info_volume->SetLabel(wxString::Format("%.2f", stats.volume*pow(koef,3))); | ||||
|     p->object_info->info_facets->SetLabel(wxString::Format(_L("%d (%d shells)"), static_cast<int>(model_object->facets_count()), stats.number_of_parts)); | ||||
|     p->object_info->info_facets->SetLabel(format_wxstr(_L_PLURAL("%1% (%2$d shell)", "%1% (%2$d shells)", stats.number_of_parts), | ||||
|                                                        static_cast<int>(model_object->facets_count()), stats.number_of_parts)); | ||||
| 
 | ||||
|     int errors = stats.degenerate_facets + stats.edges_fixed + stats.facets_removed + | ||||
|         stats.facets_added + stats.facets_reversed + stats.backwards_edges; | ||||
|     if (errors > 0) { | ||||
|         wxString tooltip = wxString::Format(_L("Auto-repaired (%d errors)"), errors); | ||||
|         wxString tooltip = format_wxstr(_L_PLURAL("Auto-repaired %1$d error", "Auto-repaired %1$d errors", errors), errors); | ||||
|         p->object_info->info_manifold->SetLabel(tooltip); | ||||
| 
 | ||||
|         tooltip += ":\n" + wxString::Format(_L("%d degenerate facets, %d edges fixed, %d facets removed, " | ||||
|                                         "%d facets added, %d facets reversed, %d backwards edges"), | ||||
|                                         stats.degenerate_facets, stats.edges_fixed, stats.facets_removed, | ||||
|                                         stats.facets_added, stats.facets_reversed, stats.backwards_edges); | ||||
|         tooltip += ":\n"; | ||||
|         if (stats.degenerate_facets > 0) | ||||
|             tooltip += format_wxstr(_L_PLURAL("%1$d degenerate facet", "%1$d degenerate facets", stats.degenerate_facets), stats.degenerate_facets) + ", "; | ||||
|         if (stats.edges_fixed > 0) | ||||
|             tooltip += format_wxstr(_L_PLURAL("%1$d edge fixed", "%1$d edges fixed", stats.edges_fixed), stats.edges_fixed) + ", "; | ||||
|         if (stats.facets_removed > 0) | ||||
|             tooltip += format_wxstr(_L_PLURAL("%1$d facet removed", "%1$d facets removed", stats.facets_removed), stats.facets_removed) + ", "; | ||||
|         if (stats.facets_added > 0) | ||||
|             tooltip += format_wxstr(_L_PLURAL("%1$d facet added", "%1$d facets added", stats.facets_added), stats.facets_added) + ", "; | ||||
|         if (stats.facets_reversed > 0) | ||||
|             tooltip += format_wxstr(_L_PLURAL("%1$d facet reversed", "%1$d facets reversed", stats.facets_reversed), stats.facets_reversed) + ", "; | ||||
|         if (stats.backwards_edges > 0) | ||||
|             tooltip += format_wxstr(_L_PLURAL("%1$d backwards edge", "%1$d backwards edges", stats.backwards_edges), stats.backwards_edges) + ", "; | ||||
|         tooltip.RemoveLast(2);//remove last coma
 | ||||
| 
 | ||||
|         p->object_info->showing_manifold_warning_icon = true; | ||||
|         p->object_info->info_manifold->SetToolTip(tooltip); | ||||
|  | @ -1107,7 +1118,7 @@ void Sidebar::update_sliced_info_sizer() | |||
|             wxString new_label = _L("Used Material (ml)") + ":"; | ||||
|             const bool is_supports = ps.support_used_material > 0.0; | ||||
|             if (is_supports) | ||||
|                 new_label += format_wxstr("\n    - %s\n    - %s", _L("object(s)"), _L("supports and pad")); | ||||
|                 new_label += format_wxstr("\n    - %s\n    - %s", _L_PLURAL("object", "objects", p->plater->model().objects.size()), _L("supports and pad")); | ||||
| 
 | ||||
|             wxString info_text = is_supports ? | ||||
|                 wxString::Format("%.2f \n%.2f \n%.2f", (ps.objects_used_material + ps.support_used_material) / 1000, | ||||
|  | @ -2412,9 +2423,11 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_ | |||
|                     // Convert even if the object is big.
 | ||||
|                     convert_from_imperial_units(model, false); | ||||
|                 else if (model.looks_like_imperial_units()) { | ||||
|                     wxMessageDialog msg_dlg(q, format_wxstr(_L( | ||||
|                         "Some object(s) in file %s looks like saved in inches.\n" | ||||
|                         "Should I consider them as a saved in inches and convert them?"), from_path(filename)) + "\n", | ||||
|                     wxMessageDialog msg_dlg(q, format_wxstr(_L_PLURAL( | ||||
|                         "The object in file %s looks like saved in inches.\n" | ||||
|                         "Should I consider it as a saved in inches and convert it?", | ||||
|                         "Some objects in file %s look like saved in inches.\n" | ||||
|                         "Should I consider them as a saved in inches and convert them?", model.objects.size()), from_path(filename)) + "\n", | ||||
|                         _L("The object appears to be saved in inches"), wxICON_WARNING | wxYES | wxNO); | ||||
|                     if (msg_dlg.ShowModal() == wxID_YES) | ||||
|                         //FIXME up-scale only the small parts?
 | ||||
|  |  | |||
|  | @ -3476,19 +3476,23 @@ void Tab::delete_preset() | |||
|             std::vector<std::string> ph_printers_only   = physical_printers.get_printers_with_only_preset(current_preset.name); | ||||
| 
 | ||||
|             if (!ph_printers.empty()) { | ||||
|                 msg += _L("The physical printer(s) below is based on the preset, you are going to delete."); | ||||
|                 msg += _L_PLURAL("The physical printer below is based on the preset, you are going to delete.",  | ||||
|                                  "The physical printers below are based on the preset, you are going to delete.", ph_printers.size()); | ||||
|                 for (const std::string& printer : ph_printers) | ||||
|                     msg += "\n    \"" + from_u8(printer) + "\","; | ||||
|                 msg.RemoveLast(); | ||||
|                 msg += "\n" + _L("Note, that selected preset will be deleted from this/those printer(s) too.")+ "\n\n"; | ||||
|                 msg += "\n" + _L_PLURAL("Note, that selected preset will be deleted from this printer too.",  | ||||
|                                         "Note, that selected preset will be deleted from these printers too.", ph_printers.size()) + "\n\n"; | ||||
|             } | ||||
| 
 | ||||
|             if (!ph_printers_only.empty()) { | ||||
|                 msg += _L("The physical printer(s) below is based only on the preset, you are going to delete."); | ||||
|                 msg += _L_PLURAL("The physical printer below is based only on the preset, you are going to delete.",  | ||||
|                                  "The physical printers below are based only on the preset, you are going to delete.", ph_printers_only.size()); | ||||
|                 for (const std::string& printer : ph_printers_only) | ||||
|                     msg += "\n    \"" + from_u8(printer) + "\","; | ||||
|                 msg.RemoveLast(); | ||||
|                 msg += "\n" + _L("Note, that this/those printer(s) will be deleted after deleting of the selected preset.") + "\n\n"; | ||||
|                 msg += "\n" + _L_PLURAL("Note, that this printer will be deleted after deleting of the selected preset.", | ||||
|                                         "Note, that these printers will be deleted after deleting of the selected preset.", ph_printers_only.size()) + "\n\n"; | ||||
|             } | ||||
|         } | ||||
|      | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka