mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-22 08:11:11 -06:00
Update localization:
* 2D.pm, 3DPreview.pm, PreviewData.cpp are marked by L() * use translating function in 3DScene.cpp
This commit is contained in:
parent
e05493bd90
commit
7047f4365a
5 changed files with 60 additions and 41 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "Analyzer.hpp"
|
||||
#include "PreviewData.hpp"
|
||||
#include <float.h>
|
||||
#include "slic3r/GUI/GUI.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -132,21 +133,21 @@ const GCodePreviewData::Color GCodePreviewData::Extrusion::Default_Extrusion_Rol
|
|||
// todo: merge with Slic3r::ExtrusionRole2String() from GCode.cpp
|
||||
const std::string GCodePreviewData::Extrusion::Default_Extrusion_Role_Names[Num_Extrusion_Roles]
|
||||
{
|
||||
"None",
|
||||
"Perimeter",
|
||||
"External perimeter",
|
||||
"Overhang perimeter",
|
||||
"Internal infill",
|
||||
"Solid infill",
|
||||
"Top solid infill",
|
||||
"Bridge infill",
|
||||
"Gap fill",
|
||||
"Skirt",
|
||||
"Support material",
|
||||
"Support material interface",
|
||||
"Wipe tower",
|
||||
"Custom",
|
||||
"Mixed"
|
||||
L("None"),
|
||||
L("Perimeter"),
|
||||
L("External perimeter"),
|
||||
L("Overhang perimeter"),
|
||||
L("Internal infill"),
|
||||
L("Solid infill"),
|
||||
L("Top solid infill"),
|
||||
L("Bridge infill"),
|
||||
L("Gap fill"),
|
||||
L("Skirt"),
|
||||
L("Support material"),
|
||||
L("Support material interface"),
|
||||
L("Wipe tower"),
|
||||
L("Custom"),
|
||||
L("Mixed")
|
||||
};
|
||||
|
||||
const GCodePreviewData::Extrusion::EViewType GCodePreviewData::Extrusion::Default_View_Type = GCodePreviewData::Extrusion::FeatureType;
|
||||
|
@ -325,15 +326,15 @@ std::string GCodePreviewData::get_legend_title() const
|
|||
switch (extrusion.view_type)
|
||||
{
|
||||
case Extrusion::FeatureType:
|
||||
return "Feature type";
|
||||
return L("Feature type");
|
||||
case Extrusion::Height:
|
||||
return "Height (mm)";
|
||||
return L("Height (mm)");
|
||||
case Extrusion::Width:
|
||||
return "Width (mm)";
|
||||
return L("Width (mm)");
|
||||
case Extrusion::Feedrate:
|
||||
return "Speed (mm/s)";
|
||||
return L("Speed (mm/s)");
|
||||
case Extrusion::Tool:
|
||||
return "Tool";
|
||||
return L("Tool");
|
||||
}
|
||||
|
||||
return "";
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <wx/image.h>
|
||||
#include <wx/settings.h>
|
||||
|
||||
#include "GUI.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
void GLIndexedVertexArray::load_mesh_flat_shading(const TriangleMesh &mesh)
|
||||
|
@ -1144,7 +1146,7 @@ bool _3DScene::LegendTexture::generate(const GCodePreviewData& preview_data, con
|
|||
m_data.clear();
|
||||
|
||||
// collects items to render
|
||||
const std::string& title = preview_data.get_legend_title();
|
||||
auto title = GUI::L_str(preview_data.get_legend_title());
|
||||
const GCodePreviewData::LegendItemsList& items = preview_data.get_legend_items(tool_colors);
|
||||
|
||||
unsigned int items_count = (unsigned int)items.size();
|
||||
|
@ -1166,7 +1168,7 @@ bool _3DScene::LegendTexture::generate(const GCodePreviewData& preview_data, con
|
|||
unsigned int max_text_height = 0;
|
||||
for (const GCodePreviewData::LegendItem& item : items)
|
||||
{
|
||||
memDC.GetTextExtent(item.text, &w, &h);
|
||||
memDC.GetTextExtent(GUI::L_str(item.text), &w, &h);
|
||||
max_text_width = std::max(max_text_width, (unsigned int)w);
|
||||
max_text_height = std::max(max_text_height, (unsigned int)h);
|
||||
}
|
||||
|
@ -1243,7 +1245,7 @@ bool _3DScene::LegendTexture::generate(const GCodePreviewData& preview_data, con
|
|||
memDC.DrawRectangle(wxRect(icon_x_inner, icon_y + 1, px_inner_square, px_inner_square));
|
||||
|
||||
// draw text
|
||||
memDC.DrawText(item.text, text_x, icon_y + text_y_offset);
|
||||
memDC.DrawText(GUI::L_str(item.text), text_x, icon_y + text_y_offset);
|
||||
|
||||
// update y
|
||||
icon_y += icon_y_step;
|
||||
|
|
|
@ -531,7 +531,7 @@ void create_combochecklist(wxComboCtrl* comboCtrl, std::string text, std::string
|
|||
|
||||
for (const std::string& item : items_str)
|
||||
{
|
||||
popup->Append(item);
|
||||
popup->Append(from_u8(item));
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < popup->GetCount(); ++i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue