mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-06 07:11:10 +00:00
Update Translations + String improvements (#16142)
Co-authored-by: Alexandre Folle de Menezes <afmenez@gmail.com>
This commit is contained in:
co-authored by
Alexandre Folle de Menezes
parent
c1e6de7e4e
commit
eb5b9a77b9
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "TextureImportDialog.hpp"
|
||||
#include "I18N.hpp"
|
||||
#include "format.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "MsgDialog.hpp"
|
||||
#include "ColorDecomposeDialog.hpp"
|
||||
@@ -745,7 +746,7 @@ private:
|
||||
: wxColour(128, 128, 128);
|
||||
|
||||
wxString name_str = (idx < m_names.size()) ? filament_name_to_wx_string(m_names[idx])
|
||||
: wxString::Format("Filament %d", display_number((int)idx));
|
||||
: wxString::Format(_L("Filament %d"), display_number((int)idx));
|
||||
row->SetToolTip(name_str);
|
||||
|
||||
row->Bind(wxEVT_PAINT, [this, idx, sq, sq_r, sq_x, gap1, fil_clr, name_str, row_bg, hover_bg, name_fg](wxPaintEvent& e) {
|
||||
@@ -828,7 +829,7 @@ private:
|
||||
row->SetBackgroundColour(row_bg);
|
||||
row->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
row->SetCursor(wxCursor(wxCURSOR_HAND));
|
||||
row->SetToolTip(entry.name.empty() ? wxString::Format("Filament %d", display_number(idx)) : filament_name_to_wx_string(entry.name));
|
||||
row->SetToolTip(entry.name.empty() ? wxString::Format(_L("Filament %d"), display_number(idx)) : filament_name_to_wx_string(entry.name));
|
||||
|
||||
row->Bind(wxEVT_PAINT, [this, entry, idx, row_bg, hover_bg, name_fg](wxPaintEvent& e) {
|
||||
auto* p = static_cast<wxPanel*>(e.GetEventObject());
|
||||
@@ -1790,7 +1791,7 @@ TextureImportDialog::TextureImportDialog(
|
||||
entry.dialog_index = (int)i;
|
||||
entry.color_hex = texture_normalize_color_hex(entry.color_hex);
|
||||
if (entry.name.empty())
|
||||
entry.name = "Filament " + std::to_string(i + 1);
|
||||
entry.name = GUI::format(_u8L("Filament %d"), i + 1);
|
||||
m_filament_color_strs.push_back(entry.color_hex);
|
||||
m_filament_names.push_back(entry.name);
|
||||
m_filament_colors_rgba.push_back(parse_color_string(entry.color_hex));
|
||||
@@ -2585,7 +2586,7 @@ void TextureImportDialog::on_computation_complete(wxCommandEvent&)
|
||||
m_filament_entries[i].color_hex = i < m_filament_color_strs.size() ?
|
||||
texture_normalize_color_hex(m_filament_color_strs[i]) : "#808080";
|
||||
m_filament_entries[i].name = i < m_filament_names.size() ?
|
||||
m_filament_names[i] : "Filament " + std::to_string(i + 1);
|
||||
m_filament_names[i] : GUI::format(_u8L("Filament %d"), i + 1);
|
||||
}
|
||||
m_new_filament_colors.clear();
|
||||
m_new_filament_preset_names.clear();
|
||||
@@ -2988,7 +2989,7 @@ void TextureImportDialog::compact_used_virtual_filaments()
|
||||
for (size_t i = 0; i < existing_count; ++i) {
|
||||
compact_colors.push_back(old_colors[i]);
|
||||
compact_color_strs.push_back(i < old_color_strs.size() ? old_color_strs[i] : "");
|
||||
compact_names.push_back(i < old_names.size() ? old_names[i] : "Filament " + std::to_string(i + 1));
|
||||
compact_names.push_back(i < old_names.size() ? old_names[i] : GUI::format(_u8L("Filament %d"), i + 1));
|
||||
TextureFilamentEntry entry = i < old_entries.size() ? old_entries[i] : TextureFilamentEntry{};
|
||||
entry.dialog_index = (int)i;
|
||||
entry.color_hex = texture_normalize_color_hex(compact_color_strs.back());
|
||||
@@ -3514,7 +3515,7 @@ void TextureImportDialog::show_filament_popup(size_t row_index)
|
||||
if (m_mapping_rows[row_index].target_panel) {
|
||||
wxString label = (idx >= 0 && idx < (int)m_filament_names.size())
|
||||
? filament_name_to_wx_string(m_filament_names[idx])
|
||||
: wxString::Format("Filament %d", display_number(idx));
|
||||
: wxString::Format(_L("Filament %d"), display_number(idx));
|
||||
m_mapping_rows[row_index].target_panel->SetToolTip(label);
|
||||
m_mapping_rows[row_index].target_panel->Refresh();
|
||||
}
|
||||
@@ -3663,7 +3664,7 @@ void TextureImportDialog::do_auto_match()
|
||||
// Match clusters to closest existing filaments
|
||||
std::vector<std::string> names;
|
||||
for (size_t i = 0; i < m_existing_filament_count; ++i)
|
||||
names.push_back(m_filament_names.size() > i ? m_filament_names[i] : "Filament " + std::to_string(i + 1));
|
||||
names.push_back(m_filament_names.size() > i ? m_filament_names[i] : GUI::format(_u8L("Filament %d"), i + 1));
|
||||
|
||||
std::vector<std::array<float, 4>> existing_filament_colors(
|
||||
m_filament_colors_rgba.begin(),
|
||||
@@ -3760,7 +3761,7 @@ void TextureImportDialog::rebuild_mapping_rows()
|
||||
auto get_filament_label = [this, display_number](int idx) -> wxString {
|
||||
if (idx >= 0 && idx < (int)m_filament_names.size())
|
||||
return filament_name_to_wx_string(m_filament_names[idx]);
|
||||
return wxString::Format("Filament %d", display_number(idx));
|
||||
return wxString::Format(_L("Filament %d"), display_number(idx));
|
||||
};
|
||||
|
||||
const wxColour dash_clr = StateColor::darkModeColorFor(wxColour("#ACACAC"));
|
||||
|
||||
Reference in New Issue
Block a user