Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Interface language: Spanish (#44)

islandmedbe08c0d2c867
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 48a643f3..707eefeb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,15 @@ All notable changes to SculptForge are listed here. The format follows
## [Unreleased]
+### Added
+- The interface in Spanish (#44): **Preferences > Interface > Language** switches between **English** (the default)
+ and **Español** at once, and Store Config keeps it. The palette bar, the palettes and their sub-palettes
+ (Preferences, SubTool, Geometry, Remesh, Masking, Polygroups and more), the top, left and right shelves, the
+ LightBox tabs, the command palette (which also finds commands by their Spanish names), Ctrl-help titles and many
+ messages are translated; tool and brush names stay as Spanish-speaking ZBrush artists use them (SubTool, QRemesh,
+ ZSpheres, LightBox, MatCap, Clay Buildup). The translations are written by hand and compiled into the program;
+ anything not yet translated shows in English.
+
## [0.10.4] - 2026-11-01
### Added
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 82085b91..42d830eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -243,6 +243,8 @@ if(SCULPTFORGE_BUILD_APP)
src/app/ShellGeometry.cpp
src/app/Palettes.cpp
src/app/Theme.cpp
+ src/app/I18n.cpp
+ src/app/I18nSpanish.cpp
src/app/CommandPalette.cpp
src/app/Console.cpp
src/app/Config.cpp
@@ -476,7 +478,7 @@ if(SCULPTFORGE_BUILD_TESTS)
# tests/test_main.cpp plus every tests/test_*.cpp (add a file to add tests; see tests/TestHarness.h).
file(GLOB SCULPTFORGE_TEST_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_*.cpp)
add_executable(sculptforge_tests ${SCULPTFORGE_TEST_SOURCES} src/cli/McpServer.cpp src/app/AssetLibrary.cpp
- src/app/UiLayout.cpp src/app/ShellGeometry.cpp src/render/Camera.cpp
+ src/app/UiLayout.cpp src/app/ShellGeometry.cpp src/app/I18n.cpp src/app/I18nSpanish.cpp src/render/Camera.cpp
src/render/Clusters.cpp src/render/Ghost.cpp)
target_include_directories(sculptforge_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
target_compile_definitions(sculptforge_tests PRIVATE SF_TEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/data")
diff --git a/docs/guide/interface.md b/docs/guide/interface.md
index 88ab8912..3424e803 100644
--- a/docs/guide/interface.md
+++ b/docs/guide/interface.md
@@ -425,6 +425,7 @@ Config keeps it.
| Setting | Default | What it does |
|---|---|---|
+| **Language** | English | The interface language: **English** or **Español** (see below) |
| **Popup Info (Ctrl+hover help)** | On | Ctrl-hover help boxes |
| **Popup Info opacity** | 0.97 | How solid the help box is |
| **Tooltip delay** | 0.5 s | How long to point at an icon-only button before its name appears |
@@ -435,6 +436,13 @@ Config keeps it.
| **UI scale** | Automatic | Size of text and controls (100% to 200%); takes effect at the next start |
| **Camera notch** | Automatic | Keeps the interface below a laptop's camera notch in fullscreen (see below) |
+**Language** changes the interface at once, without a restart; Store Config keeps it for the next start. In
+**Español** the palette bar, the palettes, the shelves, the LightBox, the command palette and the Ctrl-help titles
+are in Spanish, while the names of tools and brushes stay as Spanish-speaking ZBrush artists use them (SubTool,
+QRemesh, ZSpheres, LightBox, MatCap, Clay Buildup, Zadd). The command palette finds a command by its Spanish or its
+English name. Anything not translated yet (most Ctrl-help descriptions, this guide) shows in English. Scripts and
+`sculptforge-cli` commands are the same in every language.
+
**Preferences > Input** sets the key **Style**: **ZBrush** (the default), **SculptForge**, which brings back
the keys of SculptForge 0.6 and earlier: <kbd>1</kbd> to <kbd>9</kbd> and <kbd>0</kbd> pick the first ten
brushes (<kbd>9</kbd> is QuickSave in the ZBrush style), <kbd>I</kbd> opens Z Intensity like <kbd>U</kbd>, and
diff --git a/src/app/CommandPalette.cpp b/src/app/CommandPalette.cpp
index 7cda07f1..f38d568c 100644
--- a/src/app/CommandPalette.cpp
+++ b/src/app/CommandPalette.cpp
@@ -3,6 +3,7 @@
#include "app/CommandPalette.h"
#include "app/App.h"
+#include "app/I18n.h"
#include "app/Ui.h"
#include <IconsLucide.h>
@@ -76,9 +77,10 @@ int CommandPalette::score(const Action& a, const std::string& query) {
if (ws.empty()) return 1;
const std::string label = lower(a.label), palette = lower(a.palette), id = lower(a.id), command = lower(a.command),
description = lower(a.description);
+ const std::string shown = lower(trAction(a.id, a.label)); // the label in the interface language finds it too (#44)
int total = 0;
for (const auto& w : ws) {
- const int s = 3 * fuzzy(label, w) + 2 * fuzzy(palette, w, false) + 2 * std::max(fuzzy(id, w), fuzzy(command, w)) +
+ const int s = 3 * std::max(fuzzy(label, w), shown == label ? 0 : fuzzy(shown, w)) + 2 * fuzzy(palette, w, false) + 2 * std::max(fuzzy(id, w), fuzzy(command, w)) +
fuzzy(description, w, false);
if (s == 0) return 0; // every word must match somewhere
total += s;
@@ -167,7 +169,7 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImGui::ColorConvertU32ToFloat4(IM_COL32(0x1b, 0x1b, 0x1e, 0xff)));
ImGui::SetNextItemWidth(-FLT_MIN);
if (focus) ImGui::SetKeyboardFocusHere();
- ImGui::InputTextWithHint("##Command palette", "Search commands, brushes and settings", query_, sizeof query_);
+ ImGui::InputTextWithHint("##Command palette", tr("Search commands, brushes and settings"), query_, sizeof query_);
ImGui::PopStyleColor();
ImGui::PopStyleVar();
dl->AddText(ImVec2(fieldPos.x + 5.0f * s, fieldPos.y + 6.0f * s), ui::color::textDim, ICON_LC_SEARCH);
@@ -191,11 +193,11 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
ImGui::Dummy(ImVec2(0, 2.0f * s));
if (words(query_).empty() && n > 0 && !app.actions_.recent().empty())
- ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(ui::color::textDim), "Recently used");
+ ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(ui::color::textDim), "%s", tr("Recently used"));
const float rowH = ImGui::GetTextLineHeight() + 10.0f * s;
if (n == 0) {
ImGui::Dummy(ImVec2(0, 4.0f * s));
- ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(ui::color::textDim), " No matching commands");
+ ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(ui::color::textDim), "%s", tr(" No matching commands"));
ImGui::Dummy(ImVec2(0, 4.0f * s));
} else {
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
@@ -217,7 +219,7 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0, 0, 0, 0));
- if (ImGui::Selectable((a.label + "##pal." + a.id).c_str(), false, ImGuiSelectableFlags_None, ImVec2(w, rowH)))
+ if (ImGui::Selectable((std::string(trAction(a.id, a.label)) + "##pal." + a.id).c_str(), false, ImGuiSelectableFlags_None, ImVec2(w, rowH)))
run = r;
ImGui::PopStyleColor(4);
const bool hovered = ImGui::IsItemHovered();
@@ -231,17 +233,18 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
rows->AddText(ImVec2(x, ty), r == selected_ ? ui::color::accent : ui::color::textDim,
a.icon ? a.icon : ICON_LC_CHEVRON_RIGHT);
x += ImGui::GetFontSize() + 10.0f * s;
- rows->AddText(ImVec2(x, ty), fg, a.label.c_str());
- x += ImGui::CalcTextSize(a.label.c_str()).x + 10.0f * s;
+ const char* shownLabel = trAction(a.id, a.label);
+ rows->AddText(ImVec2(x, ty), fg, shownLabel);
+ x += ImGui::CalcTextSize(shownLabel).x + 10.0f * s;
const std::string chord = app.actions_.shortcutText(a.id);
const float keysW = chord.empty() ? 0.0f : ui::KeycapsWidth(chord);
const float right = p.x + w - 8.0f * s - keysW;
if (!a.palette.empty()) {
const ImVec4 clip(x, p.y, right - 8.0f * s, p.y + rowH);
- rows->AddText(nullptr, 0.0f, ImVec2(x, ty), ui::color::textDim, a.palette.c_str(), nullptr, 0.0f, &clip);
+ rows->AddText(nullptr, 0.0f, ImVec2(x, ty), ui::color::textDim, trPath(a.palette).c_str(), nullptr, 0.0f, &clip);
}
if (!chord.empty()) ui::KeycapsAt(rows, ImVec2(right, ty - 1.0f * s), chord);
- if (ImGui::GetCurrentContext()->LogEnabled) ImGui::LogText("\n%s %s %s", a.label.c_str(), a.palette.c_str(), chord.c_str());
+ if (ImGui::GetCurrentContext()->LogEnabled) ImGui::LogText("\n%s %s %s", trAction(a.id, a.label), trPath(a.palette).c_str(), chord.c_str());
rows->ChannelsSetCurrent(0);
if (r == selected_)
rows->AddRectFilled(p, ImVec2(p.x + w, p.y + rowH), IM_COL32(0xf0, 0x88, 0x2e, 0x30), 4.0f * s);
@@ -261,7 +264,7 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
auto hint = [&](const char* keys, const char* what) {
ui::Keycaps(keys);
ImGui::SameLine(0, 4.0f * s);
- ImGui::TextColored(dim, "%s", what);
+ ImGui::TextColored(dim, "%s", tr(what));
ImGui::SameLine(0, 14.0f * s);
};
ImGui::SetWindowFontScale(0.86f);
@@ -269,8 +272,9 @@ void CommandPalette::draw(App& app, const CanvasRect& area) {
hint("Enter", "run");
hint("Shift+Enter", "edit in console");
hint("Esc", "close");
- const std::string count = std::to_string(n) + (n == 1 ? " result" : " results");
- ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - ImGui::CalcTextSize(count.c_str()).x);
+ const std::string count = std::to_string(n) + tr(n == 1 ? " result" : " results");
+ // Right-aligned, but never over the hints (they are longer in some languages).
+ ImGui::SameLine(std::max(ImGui::GetCursorPosX(), ImGui::GetWindowContentRegionMax().x - ImGui::CalcTextSize(count.c_str()).x));
ImGui::TextColored(dim, "%s", count.c_str());
ImGui::SetWindowFontScale(1.0f);
}
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 4f4b8c33..93cf9563 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -10,6 +10,7 @@
#include "app/App.h"
#include "app/CrashLog.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Bake.h"
#include "core/Micro.h"
#include "core/Multires.h"
@@ -56,6 +57,7 @@ Json toJson(const UiPrefs& p) {
j.set("cursorFollowsSurface", p.cursorFollowsSurface);
j.set("showAxes", p.showAxes);
j.set("alphabeticalPalettes", p.alphabeticalPalettes);
+ j.set("language", p.language);
j.set("tablet", toJson(p.tablet));
j.set("spaceMouse", toJson(p.spaceMouse));
j.set("antialiasing", double(p.antialiasing));
@@ -95,6 +97,7 @@ void fromJson(const Json& j, UiPrefs& p) {
p.cursorFollowsSurface = j["cursorFollowsSurface"].asBool(p.cursorFollowsSurface);
p.showAxes = j["showAxes"].asBool(p.showAxes);
p.alphabeticalPalettes = j["alphabeticalPalettes"].asBool(p.alphabeticalPalettes);
+ if (j["language"].isString()) p.language = languageCode(languageFromCode(j["language"].asString()));
fromJson(j["tablet"], p.tablet);
fromJson(j["spaceMouse"], p.spaceMouse);
const int aa = int(j["antialiasing"].asNumber(p.antialiasing));
@@ -655,6 +658,7 @@ bool App::readUiConfig(const std::string& path, std::string& err) {
layout_.customize = customize;
actions_.overridesFromJson(j["shortcuts"]);
fromJson(j["prefs"], uiPrefs_);
+ setLanguage(languageFromCode(uiPrefs_.language));
applyPerformancePrefs();
applyInputStyle();
doc_.sculptor.dyntopo.constantDetail = uiPrefs_.dyntopoConstantDetail;
@@ -875,7 +879,7 @@ void App::drawControlsWindow() {
return;
}
// The key style (Preferences > Input), and a keymap exported from Blender (#12).
- ImGui::TextDisabled("Style");
+ ImGui::TextDisabled("%s", tr("Style"));
ImGui::SameLine();
drawInputStyleRow(ImGui::GetContentRegionAvail().x * 0.6f);
ImGui::SameLine();
@@ -890,7 +894,7 @@ void App::drawControlsWindow() {
};
ImGui::Spacing();
if (ImGui::BeginTabBar("##controls_tabs")) {
- if (ImGui::BeginTabItem("Keyboard")) {
+ if (ImGui::BeginTabItem(tr("Keyboard"))) {
ImGui::BeginChild("##controls_keys", ImVec2(0, -ImGui::GetTextLineHeightWithSpacing() * 1.6f));
// Grouped by palette, alphabetically (as ZBrush lists its palettes).
std::map<std::string, std::vector<const Action*>> groups;
@@ -928,7 +932,7 @@ void App::drawControlsWindow() {
ImGui::TextColored(col(ui::color::textDim), "Double-click a row, or Ctrl+Alt+click any button, to assign a key.");
ImGui::EndTabItem();
}
- if (ImGui::BeginTabItem("Mouse & pen")) {
+ if (ImGui::BeginTabItem(tr("Mouse & pen"))) {
if (ImGui::BeginTable("##gestures", 2, ImGuiTableFlags_RowBg | ImGuiTableFlags_PadOuterX)) {
ImGui::TableSetupColumn("what", ImGuiTableColumnFlags_WidthFixed, 180.0f * s);
ImGui::TableSetupColumn("how", ImGuiTableColumnFlags_WidthStretch);
@@ -961,7 +965,7 @@ namespace config {
void drawConfigSection(App& app) {
const ImVec2 full(-FLT_MIN, 0);
bool customize = app.layout().customize;
- if (ImGui::Checkbox("Enable Customize", &customize)) app.actions().find("config.customize")->run();
+ if (ImGui::Checkbox(tr("Enable Customize"), &customize)) app.actions().find("config.customize")->run();
ui::HelpAction(app, "config.customize");
ui::ActionButton(app, "config.store", full, ui::Look::IconLabel);
ui::ActionButton(app, "config.restore_custom", full, ui::Look::IconLabel);
@@ -972,14 +976,30 @@ void drawConfigSection(App& app) {
ui::ActionButton(app, "config.load", ImVec2(half, 0), ui::Look::IconLabel);
ImGui::PushStyleColor(ImGuiCol_Text, col(ui::color::textDim));
ImGui::PushTextWrapPos(0.0f);
- ImGui::TextUnformatted("Changes to the layout and shortcuts last until you quit. Store Config keeps them.");
+ ImGui::TextUnformatted(tr("Changes to the layout and shortcuts last until you quit. Store Config keeps them."));
ImGui::PopTextWrapPos();
ImGui::PopStyleColor();
}
void drawInterfaceSection(App& app) {
UiPrefs& p = app.uiPrefs();
- ImGui::Checkbox("Popup Info (Ctrl+hover help)", &p.popupInfo);
+ // Language (#44): each name in its own language, never translated, so it can be found in either.
+ ImGui::AlignTextToFramePadding();
+ ImGui::TextUnformatted(tr("Language"));
+ for (int i = 0; i < kLanguageCount; ++i) {
+ const Language lang = Language(i);
+ ImGui::SameLine();
+ const std::string label = std::string(languageName(lang)) + "##language." + languageCode(lang);
+ if (ImGui::RadioButton(label.c_str(), languageFromCode(p.language) == lang)) {
+ p.language = languageCode(lang);
+ setLanguage(lang);
+ }
+ ui::HelpText("Language", nullptr,
+ "The language of menus, palettes, shelves and messages. Brush and tool names (SubTool, QRemesh, "
+ "DynaMesh-style names) stay as they are, as in ZBrush. Store Config keeps it for the next start.",
+ "Preferences > Interface");
+ }
+ ImGui::Checkbox(tr("Popup Info (Ctrl+hover help)"), &p.popupInfo);
ui::HelpText("Popup Info", nullptr,
"Hold Ctrl and point at any control to see what it does and its shortcut. Ctrl+Alt shows a command's "
"scripting parameters.",
@@ -995,31 +1015,31 @@ void drawInterfaceSection(App& app) {
ui::HelpText("Tooltip delay", nullptr,
"How long to point at an icon-only button (or a clipped label) before its name appears.",
"Preferences > Interface");
- ImGui::Checkbox("One sub-palette open", &p.oneSubpalette);
+ ImGui::Checkbox(tr("One sub-palette open"), &p.oneSubpalette);
ui::HelpText("One sub-palette open", nullptr,
"Opening a sub-palette closes the others in that palette. Shift+click opens more than one.",
"Preferences > Interface");
- ImGui::Checkbox("Auto collapse left tray", &p.autoCollapseLeft);
+ ImGui::Checkbox(tr("Auto collapse left tray"), &p.autoCollapseLeft);
ui::HelpText("Auto collapse left tray", nullptr,
"Opening a palette in the left tray collapses the others when they would not fit.", "Preferences > Interface");
- ImGui::Checkbox("Auto collapse right tray", &p.autoCollapseRight);
+ ImGui::Checkbox(tr("Auto collapse right tray"), &p.autoCollapseRight);
ui::HelpText("Auto collapse right tray", nullptr,
"Opening a palette in the right tray collapses the others when they would not fit.", "Preferences > Interface");
- ImGui::Checkbox("Palettes strictly A-Z (ZBrush order)", &p.alphabeticalPalettes);
+ ImGui::Checkbox(tr("Palettes strictly A-Z (ZBrush order)"), &p.alphabeticalPalettes);
ui::HelpText("Palettes strictly A-Z", nullptr,
"Off: File and Edit come first in the palette bar and Help last, the rest A to Z. On: every palette A to Z, as in "
"ZBrush.",
"Preferences > Interface");
- ImGui::Checkbox("Left-handed layout", &app.layout().leftHanded);
+ ImGui::Checkbox(tr("Left-handed layout"), &app.layout().leftHanded);
ui::HelpText("Left-handed layout", nullptr, "Mirror the shelves and trays: tools on the left, navigation on the right.",
"Preferences > Interface");
{
static const char* kTiles[] = {"Small", "Medium", "Large"};
int& tiles = app.layout().shelfTiles;
ImGui::SetNextItemWidth(-FLT_MIN);
- if (ImGui::BeginCombo("##shelf_tiles", (std::string("Shelf tiles: ") + kTiles[std::clamp(tiles, 0, 2)]).c_str())) {
+ if (ImGui::BeginCombo("##shelf_tiles", (std::string(tr("Shelf tiles:")) + " " + tr(kTiles[std::clamp(tiles, 0, 2)])).c_str())) {
for (int i = 0; i < 3; ++i)
- if (ImGui::Selectable(kTiles[i], tiles == i)) tiles = i;
+ if (ImGui::Selectable(tr(kTiles[i]), tiles == i)) tiles = i;
ImGui::EndCombo();
}
ui::HelpText("Shelf tiles", nullptr, "How big the brush tiles on the bottom shelf are. Small leaves the most room for the model.",
@@ -1031,9 +1051,9 @@ void drawInterfaceSection(App& app) {
for (int i = 0; i < 6; ++i)
if (std::abs(kScaleValues[i] - p.uiScale) < 0.01f) current = i;
ImGui::SetNextItemWidth(-FLT_MIN);
- if (ImGui::BeginCombo("##ui_scale", (std::string("UI scale: ") + kScales[current]).c_str())) {
+ if (ImGui::BeginCombo("##ui_scale", (std::string(tr("UI scale:")) + " " + tr(kScales[current])).c_str())) {
for (int i = 0; i < 6; ++i)
- if (ImGui::Selectable(kScales[i], i == current)) p.uiScale = kScaleValues[i];
+ if (ImGui::Selectable(tr(kScales[i]), i == current)) p.uiScale = kScaleValues[i];
ImGui::EndCombo();
}
ui::HelpText("UI scale", nullptr,
@@ -1042,9 +1062,9 @@ void drawInterfaceSection(App& app) {
"Preferences > Interface");
static const char* kRotation[] = {"Free (ZBrush)", "Turntable"};
ImGui::SetNextItemWidth(-FLT_MIN);
- if (ImGui::BeginCombo("##rotation", (std::string("Rotation: ") + kRotation[p.turntable ? 1 : 0]).c_str())) {
+ if (ImGui::BeginCombo("##rotation", (std::string(tr("Rotation:")) + " " + tr(kRotation[p.turntable ? 1 : 0])).c_str())) {
for (int i = 0; i < 2; ++i)
- if (ImGui::Selectable(kRotation[i], (i == 1) == p.turntable)) p.turntable = i == 1;
+ if (ImGui::Selectable(tr(kRotation[i]), (i == 1) == p.turntable)) p.turntable = i == 1;
ImGui::EndCombo();
}
ui::HelpText("Rotation", nullptr,
@@ -1054,9 +1074,9 @@ void drawInterfaceSection(App& app) {
"Preferences > Interface");
static const char* kNotch[] = {"Automatic", "Always reserve", "Off"};
ImGui::SetNextItemWidth(-FLT_MIN);
- if (ImGui::BeginCombo("##camera_notch", (std::string("Camera notch: ") + kNotch[std::clamp(p.cameraNotch, 0, 2)]).c_str())) {
+ if (ImGui::BeginCombo("##camera_notch", (std::string(tr("Camera notch:")) + " " + tr(kNotch[std::clamp(p.cameraNotch, 0, 2)])).c_str())) {
for (int i = 0; i < 3; ++i)
- if (ImGui::Selectable(kNotch[i], i == p.cameraNotch)) p.cameraNotch = i;
+ if (ImGui::Selectable(tr(kNotch[i]), i == p.cameraNotch)) p.cameraNotch = i;
ImGui::EndCombo();
}
ui::HelpText("Camera notch", nullptr,
@@ -1068,14 +1088,16 @@ void drawInterfaceSection(App& app) {
void drawHotkeysSection(App& app) {
static char filter[64] = "";
ImGui::SetNextItemWidth(-FLT_MIN);
- ImGui::InputTextWithHint("##hotkeys_filter", ICON_LC_SEARCH " Filter", filter, sizeof filter);
+ ImGui::InputTextWithHint("##hotkeys_filter", tr(ICON_LC_SEARCH " Filter"), filter, sizeof filter);
const std::string f = lower(filter);
ActionRegistry& reg = app.actions();
const float s = ImGui::GetFontSize() / 15.0f;
std::vector<const Action*> list;
for (const auto& a : reg.all()) {
if (!a.run || a.id.rfind("cmd.", 0) == 0) continue; // commands: through the command palette
- if (!f.empty() && lower(a.label).find(f) == std::string::npos && lower(a.palette).find(f) == std::string::npos) continue;
+ if (!f.empty() && lower(a.label).find(f) == std::string::npos && lower(a.palette).find(f) == std::string::npos &&
+ lower(trAction(a.id, a.label)).find(f) == std::string::npos)
+ continue;
list.push_back(&a);
}
std::stable_sort(list.begin(), list.end(), [](const Action* x, const Action* y) {
@@ -1090,22 +1112,22 @@ void drawHotkeysSection(App& app) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
- ImGui::TextUnformatted(a->label.c_str());
+ ImGui::TextUnformatted(trAction(a->id, a->label));
ui::HelpAction(app, a->id.c_str());
ImGui::TableNextColumn();
const std::string chord = reg.shortcutText(a->id);
const bool capturing = app.capturingShortcut() == a->id;
- const std::string text = capturing ? "press a key..." : chord.empty() ? "-" : chord;
+ const std::string text = capturing ? tr("press a key...") : chord.empty() ? "-" : chord;
if (reg.hasOverride(a->id)) ImGui::PushStyleColor(ImGuiCol_Text, col(ui::color::accent));
if (ImGui::Button((text + "##hk." + a->id).c_str(), ImVec2(-FLT_MIN, 0))) app.beginShortcutCapture(a->id);
if (reg.hasOverride(a->id)) ImGui::PopStyleColor();
- ui::HelpText(("Shortcut for " + a->label).c_str(), chord.c_str(),
+ ui::HelpText((std::string(tr("Shortcut for")) + " " + trAction(a->id, a->label)).c_str(), chord.c_str(),
"Click, then press the new key. Esc cancels, Backspace clears. Orange: changed from the default.",
"Preferences > Hotkeys");
}
ImGui::EndTable();
}
- if (ImGui::Button(ICON_LC_ROTATE_CCW " Default shortcuts", ImVec2(-FLT_MIN, 0))) {
+ if (ImGui::Button(tr(ICON_LC_ROTATE_CCW " Default shortcuts"), ImVec2(-FLT_MIN, 0))) {
reg.clearOverrides();
app.status_ = "Default shortcuts restored - Store Config (Ctrl+Shift+I) to keep them";
}
@@ -1115,11 +1137,11 @@ void drawHotkeysSection(App& app) {
void drawLightBoxSection(App& app) {
UiPrefs& p = app.uiPrefs();
UiLayout& l = app.layout();
- ImGui::Checkbox("Show at startup", &p.lightboxAtStartup);
+ ImGui::Checkbox(tr("Show at startup"), &p.lightboxAtStartup);
ui::HelpText("Show LightBox at startup", nullptr, "Open LightBox on the Project tab when SculptForge starts (as ZBrush does).",
"Preferences > LightBox");
ImGui::AlignTextToFramePadding();
- ImGui::TextUnformatted("Rows");
+ ImGui::TextUnformatted(tr("Rows"));
for (int r = 1; r <= 4; ++r) {
ImGui::SameLine();
const bool on = l.lightboxRows == r;
@@ -1129,12 +1151,12 @@ void drawLightBoxSection(App& app) {
ui::HelpText("LightBox rows", nullptr, "How many rows of thumbnails the LightBox strip shows.", "Preferences > LightBox");
}
ImGui::AlignTextToFramePadding();
- ImGui::TextUnformatted("Placement");
+ ImGui::TextUnformatted(tr("Placement"));
ImGui::SameLine();
- if (ImGui::RadioButton("Top", !l.lightboxBottom)) l.lightboxBottom = false;
+ if (ImGui::RadioButton(tr("Top"), !l.lightboxBottom)) l.lightboxBottom = false;
ui::HelpText("LightBox at the top", nullptr, "LightBox opens along the top edge of the canvas.", "Preferences > LightBox");
ImGui::SameLine();
- if (ImGui::RadioButton("Bottom", l.lightboxBottom)) l.lightboxBottom = true;
+ if (ImGui::RadioButton(tr("Bottom"), l.lightboxBottom)) l.lightboxBottom = true;
ui::HelpText("LightBox at the bottom", nullptr, "LightBox opens above the bottom shelf.", "Preferences > LightBox");
ImGui::TextColored(col(ui::color::textDim), "Library folder");
const std::string shown = p.libraryFolder.empty() ? std::string("Documents/SculptForge (default)") : p.libraryFolder;
@@ -1143,7 +1165,7 @@ void drawLightBoxSection(App& app) {
ui::HelpText("Library folder", nullptr,
"Where your projects, tools, brushes, alphas, images, splats and QuickSaves live. LightBox shows it as User.",
"Preferences > LightBox");
- if (!p.libraryFolder.empty() && ImGui::SmallButton("Use the default folder")) p.libraryFolder.clear();
+ if (!p.libraryFolder.empty() && ImGui::SmallButton(tr("Use the default folder"))) p.libraryFolder.clear();
}
} // namespace config
diff --git a/src/app/Config.h b/src/app/Config.h
index a66de5e4..ef72c94c 100644
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@ -28,6 +28,7 @@ struct UiPrefs {
bool lightboxAtStartup = true;
std::string libraryFolder; // "" = Documents/SculptForge
bool alphabeticalPalettes = false; // strict A-Z palette bar like ZBrush (default: File, Edit first)
+ std::string language = "en"; // Preferences > Interface: the interface language, "en" or "es" (app/I18n.h, #44)
int cameraNotch = 0; // keep the UI out of a laptop's camera notch: 0 automatic, 1 always, 2 never
bool turntable = false; // rotation: false = free, about the screen axes (ZBrush); true = turntable (Y up)
int inputStyle = 0; // Preferences > Input: 0 ZBrush, 1 SculptForge (1-0 brushes, I = Z Intensity...),
diff --git a/src/app/I18n.cpp b/src/app/I18n.cpp
new file mode 100644
index 00000000..5d12d5af
--- /dev/null
+++ b/src/app/I18n.cpp
@@ -0,0 +1,169 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// The interface language (I18n.h): exact lookups in the compiled-in table, and
+// labels put together from a translated part and the parts that never change
+// (an icon in front, "##id" behind, "..." or ":" at the end, a printf tail).
+#include "app/I18n.h"
+
+#include <array>
+#include <atomic>
+#include <cstddef>
+#include <functional>
+#include <mutex>
+#include <string>
+#include <unordered_map>
+
+namespace sf {
+
+namespace {
+
+std::atomic<int> g_language{int(Language::English)};
+
+struct TransparentHash {
+ using is_transparent = void;
+ size_t operator()(std::string_view s) const noexcept { return std::hash<std::string_view>{}(s); }
+};
+
+const std::unordered_map<std::string_view, const char*>& spanishMap() {
+ static const std::unordered_map<std::string_view, const char*> map = [] {
+ std::unordered_map<std::string_view, const char*> m;
+ for (const i18n::Entry& e : i18n::spanishTable()) m.emplace(e.english, e.translated);
+ return m;
+ }();
+ return map;
+}
+
+// Labels put together from a translation (or found to have none), per language, kept for the life of the program
+// so the pointers tr() hands out stay valid. Capped: past it, new results go round a small ring instead.
+struct Composed {
+ bool translated = false;
+ std::string text;
+};
+struct Cache {
+ std::mutex mutex;
+ std::array<std::unordered_map<std::string, Composed, TransparentHash, std::equal_to<>>, kLanguageCount> byLanguage;
+ std::array<std::string, 256> ring;
+ size_t ringNext = 0;
+};
+Cache& cache() {
+ static Cache c;
+ return c;
+}
+constexpr size_t kCacheLimit = 1u << 16;
+
+// The translation of `text` appended to `out`: the exact entry, or one for the words before a trailing "...", ":"
+// or printf conversion ("Draw Size %.0f" from "Draw Size"). False when there is none.
+bool translateCore(Language lang, std::string_view text, std::string& out) {
+ if (text.empty()) return false;
+ if (const char* exact = i18n::lookup(lang, text)) {
+ out += exact;
+ return true;
+ }
+ auto withTail = [&](size_t headEnd, size_t tailStart) {
+ const size_t mark = out.size();
+ if (headEnd == 0 || !translateCore(lang, text.substr(0, headEnd), out)) {
+ out.resize(mark);
+ return false;
+ }
+ out += text.substr(tailStart);
+ return true;
+ };
+ if (text.size() > 3 && text.substr(text.size() - 3) == "...") return withTail(text.size() - 3, text.size() - 3);
+ if (text.size() > 1 && text.back() == ':') return withTail(text.size() - 1, text.size() - 1);
+ if (const size_t pct = text.find('%'); pct != std::string_view::npos && pct > 0) {
+ size_t head = pct;
+ while (head > 0 && text[head - 1] == ' ') --head;
+ return withTail(head, head);
+ }
+ return false;
+}
+
+// A label in parts: [icon + spaces][words][##id...]. Returns false when the words have no translation.
+bool compose(Language lang, std::string_view label, std::string& out) {
+ size_t start = 0;
+ // Lucide icons (U+E038-U+E798) are UTF-8 0xEE xx xx; the label's words follow after spaces.
+ while (start + 3 <= label.size() && static_cast<unsigned char>(label[start]) == 0xEE) {
+ start += 3;
+ while (start < label.size() && label[start] == ' ') ++start;
+ }
+ const size_t hash = label.find("##", start);
+ const size_t end = hash == std::string_view::npos ? label.size() : hash;
+ out.assign(label.substr(0, start));
+ if (!translateCore(lang, label.substr(start, end - start), out)) return false;
+ out += label.substr(end);
+ return true;
+}
+
+} // namespace
+
+void setLanguage(Language language) { g_language.store(int(language)); }
+
+Language language() { return Language(g_language.load()); }
+
+const char* languageCode(Language language) { return language == Language::Spanish ? "es" : "en"; }
+
+Language languageFromCode(std::string_view code) {
+ if (code == "es" || code.substr(0, 3) == "es-" || code.substr(0, 3) == "es_") return Language::Spanish;
+ return Language::English;
+}
+
+const char* languageName(Language language) { return language == Language::Spanish ? "Español" : "English"; }
+
+namespace i18n {
+
+const char* lookup(Language language, std::string_view english) {
+ if (language != Language::Spanish) return nullptr;
+ const auto& map = spanishMap();
+ const auto it = map.find(english);
+ return it == map.end() ? nullptr : it->second;
+}
+
+} // namespace i18n
+
+const char* tr(const char* english) {
+ const Language lang = language();
+ if (lang == Language::English || !english || !*english) return english;
+ const std::string_view key(english);
+ if (const char* exact = i18n::lookup(lang, key)) return exact;
+ Cache& c = cache();
+ std::lock_guard lock(c.mutex);
+ auto& map = c.byLanguage[size_t(lang)];
+ if (const auto it = map.find(key); it != map.end()) return it->second.translated ? it->second.text.c_str() : english;
+ Composed composed;
+ composed.translated = compose(lang, key, composed.text);
+ if (map.size() < kCacheLimit) {
+ const auto it = map.emplace(std::string(key), std::move(composed)).first;
+ return it->second.translated ? it->second.text.c_str() : english;
+ }
+ if (!composed.translated) return english;
+ std::string& slot = c.ring[c.ringNext++ % c.ring.size()];
+ slot = std::move(composed.text);
+ return slot.c_str();
+}
+
+std::string tr(const std::string& english) {
+ if (language() == Language::English) return english;
+ return tr(english.c_str());
+}
+
+const char* trAction(std::string_view actionId, const std::string& label) {
+ if (actionId.substr(0, 6) == "brush.") return label.c_str();
+ return tr(label.c_str());
+}
+
+std::string trPath(std::string_view path) {
+ if (language() == Language::English) return std::string(path);
+ std::string out;
+ size_t start = 0;
+ while (true) {
+ const size_t sep = path.find(" > ", start);
+ out += tr(std::string(path.substr(start, sep == std::string_view::npos ? std::string_view::npos : sep - start)));
+ if (sep == std::string_view::npos) break;
+ out += " > ";
+ start = sep + 3;
+ }
+ return out;
+}
+
+} // namespace sf
diff --git a/src/app/I18n.h b/src/app/I18n.h
new file mode 100644
index 00000000..c96c724f
--- /dev/null
+++ b/src/app/I18n.h
@@ -0,0 +1,56 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// The interface language (#44): English, the default, and Spanish. A small,
+// dependency-free layer: the English text is the key, the translations are a
+// table compiled into the binary (I18nSpanish.cpp), and anything without an
+// entry stays in English, so a missing line never breaks a label.
+//
+// ImGui::Button(tr("Decimate")) "Diezmar" in Spanish
+// ImGui::Checkbox(tr("Keep Masked##remesh")) only "Keep Masked" is translated; "##remesh" is kept as it is
+// tr(ICON_LC_SAVE " Save") the icon prefix is kept, the words translated
+// tr("Draw Size %.0f") an exact entry first, else "Draw Size" and " %.0f" kept
+// tr("Save As...") an exact entry first, else "Save As" + "..."
+//
+// tr() never changes anything in English (it returns its argument), so UI tests
+// and layouts keyed by English labels keep working. In Spanish the visible part
+// changes and everything from "##" on stays the same.
+#pragma once
+
+#include <span>
+#include <string>
+#include <string_view>
+
+namespace sf {
+
+enum class Language { English, Spanish };
+inline constexpr int kLanguageCount = 2;
+
+// The language tr() translates into (process-wide; Preferences > Interface sets it).
+void setLanguage(Language language);
+Language language();
+const char* languageCode(Language language); // "en", "es" (ui.json)
+Language languageFromCode(std::string_view code); // unknown codes are English
+const char* languageName(Language language); // in that language: "English", "Español"
+
+// The text in the current language. The pointer is the argument itself (English, or no translation), a table
+// entry, or a string kept for the life of the program: safe to keep across frames.
+const char* tr(const char* english);
+std::string tr(const std::string& english);
+// An action's label: brushes keep their names (Clay Buildup, Move, Smooth...), everything else is translated.
+const char* trAction(std::string_view actionId, const std::string& label);
+// A palette path with each step translated: "Tool > Geometry" -> "Herramienta > Geometría".
+std::string trPath(std::string_view path);
+
+namespace i18n {
+struct Entry {
+ const char* english;
+ const char* translated;
+};
+// The compiled-in Spanish table (I18nSpanish.cpp), for tests.
+std::span<const Entry> spanishTable();
+// The exact entry for `english` in that language's table, or nullptr (English has no table).
+const char* lookup(Language language, std::string_view english);
+} // namespace i18n
+
+} // namespace sf
diff --git a/src/app/I18nSpanish.cpp b/src/app/I18nSpanish.cpp
new file mode 100644
index 00000000..22838756
--- /dev/null
+++ b/src/app/I18nSpanish.cpp
@@ -0,0 +1,903 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// The Spanish interface (#44), written by hand for SculptForge. The English text
+// is the key (I18n.h); a label without an entry stays in English.
+//
+// Conventions, as Spanish-speaking ZBrush artists use them:
+// - Names of tools, brushes and products stay in English: SubTool, QRemesh, ZSpheres, LightBox, MatCap, Polypaint,
+// Clay Buildup and every other brush, Zadd / Zsub, Smt, Rgb, PolyF, ProjectAll, LazyMouse, MaskPen, VDM.
+// - Palettes and actions read as ZBrush's own Spanish: Pincel, Trazo, Herramienta, Dibujar, Tamaño de dibujo,
+// Intensidad Z, Desplazamiento focal, Dividir, Poligrupos, Enmascarado.
+// - Short and imperative, "tú" (Elige, Guarda), sentence case like the English.
+// - printf conversions (%d, %.1f, %s, %%) stay in the same order: tests check every entry.
+// Keep the entries sorted by English within each group, one entry per English text.
+#include "app/I18n.h"
+
+#include <iterator>
+
+namespace sf::i18n {
+
+namespace {
+
+constexpr Entry kSpanish[] = {
+ // --- Palettes (the palette bar) and their sub-palettes ---
+ {"Alpha", "Alpha"},
+ {"Brush", "Pincel"},
+ {"Color", "Color"},
+ {"Draw", "Dibujar"},
+ {"Edit", "Editar"},
+ {"File", "Archivo"},
+ {"Generate", "Generar"},
+ {"Help", "Ayuda"},
+ {"Material", "Material"},
+ {"Preferences", "Preferencias"},
+ {"Render", "Render"},
+ {"Script", "Script"},
+ {"Splats", "Splats"},
+ {"Stroke", "Trazo"},
+ {"Tool", "Herramienta"},
+ {"Transform", "Transformar"},
+ {"AI brush provider", "Proveedor del pincel IA"},
+ {"Autosave", "Autoguardado"},
+ {"Bake", "Bake"},
+ {"Config", "Configuración"},
+ {"Deformation", "Deformación"},
+ {"Display", "Visualización"},
+ {"Export", "Exportar"},
+ {"Facial Shapes", "Formas faciales"},
+ {"Geometry", "Geometría"},
+ {"Hotkeys", "Atajos de teclado"},
+ {"Input", "Entrada"},
+ {"Interface", "Interfaz"},
+ {"Kelvinlet & Capture", "Kelvinlet y captura"},
+ {"Layers", "Capas"},
+ {"LightBox", "LightBox"},
+ {"Masking", "Enmascarado"},
+ {"Paint Layers", "Capas de pintura"},
+ {"Performance", "Rendimiento"},
+ {"Polygroups", "Poligrupos"},
+ {"Remesh", "Remallado"},
+ {"SubTool", "SubTool"},
+ {"Tablet", "Tableta"},
+ {"Texture Map", "Mapa de textura"},
+ {"Updates", "Actualizaciones"},
+ {"Vector Displacement", "Desplazamiento vectorial"},
+ {"Visibility", "Visibilidad"},
+ {"ZSpheres", "ZSpheres"},
+ {"Edit recipe", "Editar receta"},
+
+ // --- Palette paths in the Ctrl-help box ("Tool > Geometry") ---
+ {"Bottom shelf", "Estante inferior"},
+ {"Left shelf", "Estante izquierdo"},
+ {"Right shelf", "Estante derecho"},
+ {"Top shelf", "Estante superior"},
+ {"Title", "Barra de título"},
+ {"Layout", "Diseño"},
+ {"Dynamic topology", "Topología dinámica"},
+ {"Camera", "Cámara"},
+ {"Import / Export", "Importar / Exportar"},
+ {"From an image", "A partir de una imagen"},
+ {"Voxel Remesh", "Remallado por vóxeles"},
+ {"Modify Topology", "Modificar topología"},
+ {"Game Ready", "Listo para juegos"},
+ {"Navigation", "Navegación"},
+
+ // --- Title bar, status line, search ---
+ {"Untitled", "Sin título"},
+ {"Project", "Proyecto"},
+ {"Search", "Buscar"},
+ {"Minimize", "Minimizar"},
+ {"Menus", "Menús"},
+ {"QuickSave", "QuickSave"},
+ {"Base", "Base"},
+ {" Splats ", " Splats "},
+ {"Verts %s Tris %s SubTool %s (%d/%d) Layer %s%s%s", "Vért. %s Tris %s SubTool %s (%d/%d) Capa %s%s%s"},
+ {"Customize: Ctrl+Alt+drag to move or remove items", "Personalizar: Ctrl+Alt+arrastrar para mover o quitar elementos"},
+ {"Customize off", "Personalizar desactivado"},
+ {"UI configuration stored", "Configuración de la interfaz guardada"},
+ {"Standard UI restored - Store Config (Ctrl+Shift+I) to keep it",
+ "Interfaz estándar restaurada: Store Config (Ctrl+Shift+I) para conservarla"},
+ {"Custom UI restored", "Interfaz personalizada restaurada"},
+ {"No stored UI configuration yet - Store Config (Ctrl+Shift+I) first",
+ "Aún no hay configuración guardada: usa Store Config (Ctrl+Shift+I) primero"},
+ {"Saved", "Guardado"},
+ {"Background: Flat Colour", "Fondo: color plano"},
+ {"Background: Gradient", "Fondo: degradado"},
+
+ // --- Command palette ---
+ {"Search commands, brushes and settings", "Buscar comandos, pinceles y ajustes"},
+ {"Recently used", "Usados recientemente"},
+ {" No matching commands", " Ningún comando coincide"},
+ {" result", " resultado"},
+ {" results", " resultados"},
+ {"select", "elegir"},
+ {"run", "ejecutar"},
+ {"edit in console", "a la consola"},
+ {"close", "cerrar"},
+
+ // --- Ctrl-help box ---
+ {"No description yet.", "Aún sin descripción."},
+ {"Not available right now.", "No disponible ahora mismo."},
+ {"Learn more: %s", "Más información: %s"},
+ {"Back to the palette bar", "Volver a la barra de paletas"},
+ {"Move to the tray", "Mover a la bandeja"},
+ {"Take this palette out of the tray.", "Saca esta paleta de la bandeja."},
+ {"Keep this palette in the right tray (Shift+click: left tray), or drag the icon onto a tray.",
+ "Deja esta paleta en la bandeja derecha (Mayús+clic: la izquierda), o arrastra el icono a una bandeja."},
+ {"Click to open or close. Opening one closes the others (Shift+click keeps them open; Preferences > Interface).",
+ "Clic para abrir o cerrar. Al abrir una se cierran las demás (Mayús+clic las mantiene abiertas; Preferencias > "
+ "Interfaz)."},
+ {"Click to save the project. * means it has unsaved changes.",
+ "Clic para guardar el proyecto. * indica que tiene cambios sin guardar."},
+ {"Find any command, brush or material by name and run it.",
+ "Busca cualquier comando, pincel o material por su nombre y ejecútalo."},
+ {"Minimize the SculptForge window.", "Minimiza la ventana de SculptForge."},
+ {"Left tray", "Bandeja izquierda"},
+ {"Right tray", "Bandeja derecha"},
+ {"Shortcut for", "Atajo para"},
+
+ // --- Shelves ---
+ {"Add a brush", "Añadir pincel"},
+ {"Put another brush (built-in or one of yours) on this shelf.",
+ "Pon otro pincel (de serie o uno tuyo) en este estante."},
+ {"One of your custom brushes.", "Uno de tus pinceles personalizados."},
+ {"Remove from shelf", "Quitar del estante"},
+ {"Tile size", "Tamaño de las fichas"},
+ {"Small", "Pequeño"},
+ {"Medium", "Mediano"},
+ {"Large", "Grande"},
+ {"The active brush. Click for the brush picker; the bottom shelf holds favourites.",
+ "El pincel activo. Clic para elegir pincel; el estante inferior guarda los favoritos."},
+ {"How dabs follow the cursor: Dots, DragRect, DragDot, Spray or LazyMouse. Click to choose.",
+ "Cómo siguen los toques al cursor: Dots, DragRect, DragDot, Spray o LazyMouse. Clic para elegir."},
+ {"The VDM brush's vector displacement map. Click to pick another.",
+ "El mapa de desplazamiento vectorial del pincel VDM. Clic para elegir otro."},
+ {"The brush's stamp shape (white = full effect). Click for the alpha picker.",
+ "La forma del sello del pincel (blanco = efecto completo). Clic para elegir alpha."},
+ {"How the model is shaded in the view. Click for the material picker.",
+ "Cómo se sombrea el modelo en la vista. Clic para elegir material."},
+ {"Brush radius in screen pixels. [ and ] change it by 10%; Ctrl+click to type.",
+ "Radio del pincel en píxeles de pantalla. [ y ] lo cambian un 10%; Ctrl+clic para escribirlo."},
+ {"Brush radius in screen pixels. [ and ] change it by 10%.",
+ "Radio del pincel en píxeles de pantalla. [ y ] lo cambian un 10%."},
+ {"ActiveTris / TotalTris", "Tris activos / Tris totales"},
+ {"Move", "Mover"},
+ {"Zoom", "Zoom"},
+ {"Rotate", "Rotar"},
+ {"Scale", "Escalar"},
+
+ // --- Draw and the top shelf ---
+ {"Draw Size", "Tamaño de dibujo"},
+ {"Z Intensity", "Intensidad Z"},
+ {"Smooth Z Intensity", "Intensidad Z de Smooth"},
+ {"RGB Intensity", "Intensidad RGB"},
+ {"Focal Shift", "Desplazamiento focal"},
+ {"Focal Length", "Distancia focal"},
+ {"Detail", "Detalle"},
+ {"Sculpt", "Esculpir"},
+ {"Paint", "Pintar"},
+ {"Dynamic", "Dinámica"},
+ {"Constant detail", "Detalle constante"},
+ {"Axes", "Ejes"},
+ {"No pen detected", "No se detecta lápiz"},
+ {"Pen pressure", "Presión del lápiz"},
+ {"Pressure > Size", "Presión > Tamaño"},
+ {"Pressure > Strength", "Presión > Fuerza"},
+ {"Front faces only", "Solo caras frontales"},
+ {"Invert (Alt)", "Invertir (Alt)"},
+ {"Invert", "Invertir"},
+ {"Smooth keeps volume", "Smooth conserva el volumen"},
+ {"Symmetry", "Simetría"},
+ {"Symmetry X", "Simetría X"},
+ {"How strongly painting colours the surface (1-100); Ctrl+click to type.",
+ "Con qué fuerza colorea la pintura la superficie (1-100); Ctrl+clic para escribirlo."},
+ {"This SubTool has subdivision levels, so strokes don't remesh it: delete the lower (or higher) levels first.",
+ "Este SubTool tiene niveles de subdivisión, así que los trazos no lo remallan: borra antes los niveles "
+ "inferiores (o superiores)."},
+
+ // --- Edit, File, Help ---
+ {"Undo", "Deshacer"},
+ {"Redo", "Rehacer"},
+ {"Paste brush", "Pegar pincel"},
+ {"New Sphere", "Nueva esfera"},
+ {"New Plane", "Nuevo plano"},
+ {"New ZSphere", "Nueva ZSphere"},
+ {"Open", "Abrir"},
+ {"Open Recent", "Abrir reciente"},
+ {"Save", "Guardar"},
+ {"Save As", "Guardar como"},
+ {"Import", "Importar"},
+ {"Export OBJ", "Exportar OBJ"},
+ {"Export STL", "Exportar STL"},
+ {"Export GLB", "Exportar GLB"},
+ {"Export LOD Chain", "Exportar cadena de LOD"},
+ {"Export USD / USDZ", "Exportar USD / USDZ"},
+ {"Export FBX for Unreal", "Exportar FBX para Unreal"},
+ {"Export EXR", "Exportar EXR"},
+ {"Export Maps", "Exportar mapas"},
+ {"Export Texture", "Exportar textura"},
+ {"Export Displacement", "Exportar desplazamiento"},
+ {"Export timelapse", "Exportar timelapse"},
+ {"Send to Unreal", "Enviar a Unreal"},
+ {"Send to Blender", "Enviar a Blender"},
+ {"Receive from Blender", "Recibir de Blender"},
+ {"Save Splats", "Guardar splats"},
+ {"Capture from phone", "Capturar con el móvil"},
+ {"Quit", "Salir"},
+ {"Controls", "Controles"},
+ {"User Guide", "Guía del usuario"},
+ {"What's New", "Novedades"},
+ {"Check for updates", "Buscar actualizaciones"},
+ {"Command palette", "Paleta de comandos"},
+ {"Website & documentation", "Web y documentación"},
+ {"Report a problem", "Informar de un problema"},
+ {"Open log folder", "Abrir la carpeta de registros"},
+ {"Fixes & suggestions", "Correcciones y sugerencias"},
+ {"Benchmark (proof mode)", "Prueba de rendimiento (modo prueba)"},
+ {"Support SculptForge", "Apoya a SculptForge"},
+ {"About SculptForge", "Acerca de SculptForge"},
+ {"Welcome", "Bienvenida"},
+
+ // --- Generate ---
+ {"Generate 3D", "Generar 3D"},
+ {"Choose image", "Elegir imagen"},
+ {"Change image", "Cambiar imagen"},
+ {"Relief", "Relieve"},
+ {"Inflate", "Inflar"},
+ {"Stamp", "Estampar"},
+ {"AI Brush", "Pincel IA"},
+ {"Image or text to a sculptable 3D model: Hugging Face (free), fal.ai, Meshy, your ComfyUI server, your own "
+ "command, or an offline blockout.",
+ "De una imagen o un texto a un modelo 3D esculpible: Hugging Face (gratis), fal.ai, Meshy, tu servidor ComfyUI, "
+ "tu propio comando o un bloqueo sin conexión."},
+
+ // --- Render, Display, Material ---
+ {"Wireframe", "Malla de alambre"},
+ {"Show Mesh", "Mostrar malla"},
+ {"Show Polypaint", "Mostrar Polypaint"},
+ {"Show Mask", "Mostrar máscara"},
+ {"Show Polygroups", "Mostrar poligrupos"},
+ {"Show Splats", "Mostrar splats"},
+ {"Show mesh", "Mostrar malla"},
+ {"Show mask", "Mostrar máscara"},
+ {"Show polygroups", "Mostrar poligrupos"},
+ {"Show polypaint", "Mostrar Polypaint"},
+ {"Show texture", "Mostrar textura"},
+ {"Show UVs", "Mostrar UVs"},
+ {"Mask", "Máscara"},
+ {"Groups", "Grupos"},
+ {"Material colour", "Color del material"},
+ {"Colour of the Studio material (the clay colour).", "Color del material Studio (el color de la arcilla)."},
+ {"Frame model", "Encuadrar modelo"},
+ {"Frame SubTool", "Encuadrar SubTool"},
+ {"Fullscreen", "Pantalla completa"},
+ {"Gradient", "Degradado"},
+ {"Flat Colour", "Color plano"},
+ {"Background colour", "Color de fondo"},
+ {"Flat", "Plano"},
+ {"Load MatCap", "Cargar MatCap"},
+ {"Material picker", "Selector de materiales"},
+ {"Material swatches", "Muestras de material"},
+
+ // --- Script ---
+ {"Console", "Consola"},
+ {"Run script file", "Ejecutar archivo de script"},
+ {"Copy session as script", "Copiar la sesión como script"},
+ {"Clear console", "Limpiar la consola"},
+ {"Close the console", "Cerrar la consola"},
+ {"Every action is a script command: run them with --script \"subdivide; remesh resolution=200\" or the "
+ "sculptforge-cli tool.",
+ "Cada acción es un comando de script: ejecútalas con --script \"subdivide; remesh resolution=200\" o con la "
+ "herramienta sculptforge-cli."},
+
+ // --- Stroke ---
+ {"Continuous", "Continuo"},
+ {"Stroke picker", "Selector de trazos"},
+ {"Lazy radius", "Radio Lazy"},
+
+ // --- Tool: header, SubTool ---
+ {"tris", "tris"},
+ {"Append", "Añadir"},
+ {"Append as SubTool", "Añadir como SubTool"},
+ {"Add a new SubTool beside the model", "Añade un SubTool nuevo junto al modelo"},
+ {"Insert on the model", "Insertar en el modelo"},
+ {"Duplicate", "Duplicar"},
+ {"Rename", "Renombrar"},
+ {"Delete", "Eliminar"},
+ {"Move up", "Subir"},
+ {"Move down", "Bajar"},
+ {"Move up the list", "Sube en la lista"},
+ {"Move down the list", "Baja en la lista"},
+ {"Merge down", "Combinar abajo"},
+ {"Merge the active SubTool with the one below it", "Combina el SubTool activo con el que tiene debajo"},
+ {"Merge visible", "Combinar visibles"},
+ {"Split parts", "Separar partes"},
+ {"Split groups", "Separar grupos"},
+ {"One SubTool per disconnected piece", "Un SubTool por cada pieza separada"},
+ {"One SubTool per polygroup", "Un SubTool por cada poligrupo"},
+ {"Alt+click a SubTool to select it", "Alt+clic en un SubTool para seleccionarlo"},
+ {"All SubTools", "Todos los SubTools"},
+ {"Solo", "Solo"},
+ {"Sphere", "Esfera"},
+ {"Cube", "Cubo"},
+ {"Plane", "Plano"},
+ {"From file", "Desde archivo"},
+ {"Active SubTool's copy", "Copia del SubTool activo"},
+ {"Not enough GPU memory to show every SubTool: hide some or step down a subdivision level.",
+ "No hay memoria de GPU suficiente para mostrar todos los SubTools: oculta alguno o baja un nivel de "
+ "subdivisión."},
+ {"%s\n%zu vertices, %zu triangles%s%s\nClick to select, double-click to rename",
+ "%s\n%zu vértices, %zu triángulos%s%s\nClic para seleccionar, doble clic para renombrar"},
+ {"Extract", "Extraer"},
+ {"Accept", "Aceptar"},
+ {"Double", "Doble"},
+ {"Thick", "Grosor"},
+ {"ProjectAll", "ProjectAll"},
+ {"Dist", "Dist"},
+
+ // --- Geometry ---
+ {"Divide", "Dividir"},
+ {"Subdivide", "Subdividir"},
+ {"Lower Res", "Res. menor"},
+ {"Higher Res", "Res. mayor"},
+ {"Del Lower", "Borrar inferiores"},
+ {"Del Higher", "Borrar superiores"},
+ {"Reconstruct Subdiv", "Reconstruir subdiv."},
+ {"Divide to Micro", "Dividir a micro"},
+ {"Delete Micro", "Eliminar micro"},
+ {"Bake Micro", "Hacer bake de micro"},
+ {"Micro Surface Noise", "Ruido de superficie micro"},
+ {"Micro", "Micro"},
+ {"SDiv", "SDiv"},
+ {"No subdivision levels - Divide adds them", "Sin niveles de subdivisión: Dividir los añade"},
+ {"Decimate", "Diezmar"},
+ {"Keep", "Conservar"},
+ {"Keep Masked", "Conservar máscara"},
+ {"Keep Groups", "Conservar grupos"},
+ {"Keep Original", "Conservar original"},
+ {"Keep Texture", "Conservar textura"},
+ {"Reduce the triangle count while keeping the shape. Sculpt layers are kept.",
+ "Reduce el número de triángulos conservando la forma. Las capas de esculpido se conservan."},
+ {"Fraction of the triangles Decimate keeps.", "Fracción de los triángulos que conserva Diezmar."},
+ {"Mirror", "Reflejar"},
+ {"Mirror And Weld", "Reflejar y soldar"},
+ {"Close Gaps", "Cerrar huecos"},
+ {"Fill holes", "Rellenar agujeros"},
+ {"Delete hidden", "Eliminar ocultos"},
+
+ // --- QRemesh and Remesh ---
+ {"QRemesh", "QRemesh"},
+ {"QRemesh Guides", "Guías de QRemesh"},
+ {"Target Polygons", "Polígonos objetivo"},
+ {"Adaptive Size", "Tamaño adaptativo"},
+ {"Curves Strength", "Fuerza de las curvas"},
+ {"Guides", "Guías"},
+ {"Use Polypaint", "Usar Polypaint"},
+ {"Detect Edges", "Detectar bordes"},
+ {"Half", "Mitad"},
+ {"Same", "Igual"},
+ {"Quality Report", "Informe de calidad"},
+ {"no curves", "sin curvas"},
+ {"%zu curves (%zu loops)", "%zu curvas (%zu bucles)"},
+ {"%zu polygons", "%zu polígonos"},
+ {"%s: %zu quads in %.1f s", "%s: %zu quads en %.1f s"},
+ {"%zu piece(s) used the legacy method", "%zu pieza(s) usaron el método anterior"},
+ {"Corners off square: %.1f deg mean, %.0f deg worst 1%%",
+ "Esquinas fuera de escuadra: %.1f° de media, %.0f° en el peor 1%%"},
+ {"Poles: %zu (3 edges %zu, 5 edges %zu, other %zu)", "Polos: %zu (3 aristas %zu, 5 aristas %zu, otros %zu)"},
+ {"Distance to the sculpt: %.3f%% mean, %.2f%% max", "Distancia a la escultura: %.3f%% de media, %.2f%% máx."},
+ {"Resolution", "Resolución"},
+ {"Remeshing", "Remallando"},
+ {"Cancel", "Cancelar"},
+ {"Stop the remesh; the SubTool stays as it is.", "Detén el remallado; el SubTool se queda como está."},
+ {"Voxels across the model: higher keeps more detail and makes more triangles.",
+ "Vóxeles a lo ancho del modelo: más conserva más detalle y genera más triángulos."},
+ {"Remesh for sculpting", "Remallar para esculpir"},
+
+ // --- Masking ---
+ {"Clear", "Borrar"},
+ {"All", "Todo"},
+ {"Blur", "Difuminar"},
+ {"Sharpen", "Enfocar"},
+ {"Grow", "Expandir"},
+ {"Shrink", "Contraer"},
+ {"By cavity", "Por cavidad"},
+ {"By polygroup", "Por poligrupo"},
+ {"Passes", "Pasadas"},
+ {"Mask Strength", "Fuerza de la máscara"},
+ {"Threshold", "Umbral"},
+ {"Clear Mask", "Borrar máscara"},
+ {"Invert Mask", "Invertir máscara"},
+ {"Mask All", "Enmascarar todo"},
+ {"Mask brush", "Pincel de máscara"},
+ {"Unmask everything (MaskPen: Ctrl + drag background)", "Quita toda la máscara (MaskPen: Ctrl + arrastrar el fondo)"},
+ {"Ctrl + click background", "Ctrl + clic en el fondo"},
+ {"Mask creases and folds (replaces the mask; uses the mask strength)",
+ "Enmascara pliegues y arrugas (sustituye la máscara; usa la fuerza de la máscara)"},
+ {"Mask one polygroup (replaces the mask)", "Enmascara un poligrupo (sustituye la máscara)"},
+
+ // --- Polygroups and Visibility ---
+ {"By normals", "Por normales"},
+ {"By pieces", "Por piezas"},
+ {"From mask", "Desde la máscara"},
+ {"Clear groups", "Borrar grupos"},
+ {"Angle", "Ángulo"},
+ {"Group Masked", "Agrupar enmascarado"},
+ {"Group by UVs", "Agrupar por UVs"},
+ {"Masked triangles become a new group", "Los triángulos enmascarados forman un grupo nuevo"},
+ {"New group wherever the surface turns more than the angle",
+ "Grupo nuevo donde la superficie gira más que el ángulo"},
+ {"One group per disconnected piece", "Un grupo por cada pieza separada"},
+ {"Visible polygroups", "Poligrupos visibles"},
+ {"Hide polygroup under cursor", "Ocultar el poligrupo bajo el cursor"},
+ {"Isolate polygroup under cursor", "Aislar el poligrupo bajo el cursor"},
+ {"Show all", "Mostrar todo"},
+ {"Unhide all", "Mostrar todo"},
+ {"Invert visible", "Invertir visibles"},
+ {"Hide", "Ocultar"},
+ {"Show", "Mostrar"},
+ {"Ctrl+Shift+click a group to isolate it, +Alt to hide it, on the background to show all.\n"
+ "Ctrl+Shift+drag hides outside the rectangle or lasso (Alt: inside).",
+ "Ctrl+Mayús+clic en un grupo para aislarlo, +Alt para ocultarlo, en el fondo para mostrar todo.\n"
+ "Ctrl+Mayús+arrastrar oculta lo que queda fuera del rectángulo o el lazo (Alt: dentro)."},
+
+ // --- Layers, paint, texture ---
+ {"New paint layer", "Nueva capa de pintura"},
+ {"Delete layer", "Eliminar capa"},
+ {"Opacity", "Opacidad"},
+ {"Blend mode", "Modo de fusión"},
+ {"Texture", "Textura"},
+ {"New Texture", "Nueva textura"},
+ {"Import Texture", "Importar textura"},
+ {"Delete Texture", "Eliminar textura"},
+ {"Polypaint > Texture", "Polypaint > Textura"},
+ {"Texture > Polypaint", "Textura > Polypaint"},
+ {"Texture size", "Tamaño de textura"},
+ {"Auto UV", "UV automáticas"},
+ {"Pick colour", "Tomar color"},
+ {"Switch Color", "Intercambiar color"},
+ {"Main colour", "Color principal"},
+ {"Second colour", "Color secundario"},
+
+ // --- Transform and the gizmo ---
+ {"Gizmo 3D", "Gizmo 3D"},
+ {"Front view", "Vista frontal"},
+ {"Back view", "Vista trasera"},
+ {"Left view", "Vista izquierda"},
+ {"Right view", "Vista derecha"},
+ {"Top view", "Vista superior"},
+ {"Bottom view", "Vista inferior"},
+ {"Opposite side", "Lado opuesto"},
+ {"Orbit left", "Orbitar a la izquierda"},
+ {"Orbit right", "Orbitar a la derecha"},
+ {"Orbit up", "Orbitar hacia arriba"},
+ {"Orbit down", "Orbitar hacia abajo"},
+ {"Zoom in", "Acercar"},
+ {"Zoom out", "Alejar"},
+ {"Orthographic", "Ortográfica"},
+ {"Larger brush", "Pincel más grande"},
+ {"Smaller brush", "Pincel más pequeño"},
+ {"Pivot", "Pivote"},
+
+ // --- Preferences > Config ---
+ {"Enable Customize", "Activar personalización"},
+ {"Store Config", "Store Config"},
+ {"Restore Custom UI", "Restaurar interfaz personalizada"},
+ {"Restore Standard UI", "Restaurar interfaz estándar"},
+ {"Load UI", "Cargar interfaz"},
+ {"Save UI", "Guardar interfaz"},
+ {"Changes to the layout and shortcuts last until you quit. Store Config keeps them.",
+ "Los cambios del diseño y los atajos duran hasta que salgas. Store Config los conserva."},
+
+ // --- Preferences > Interface ---
+ {"Language", "Idioma"},
+ {"The language of menus, palettes, shelves and messages. Brush and tool names (SubTool, QRemesh, DynaMesh-style "
+ "names) stay as they are, as in ZBrush. Store Config keeps it for the next start.",
+ "El idioma de los menús, las paletas, los estantes y los mensajes. Los nombres de pinceles y herramientas "
+ "(SubTool, QRemesh y similares) se quedan como están, igual que en ZBrush. Store Config lo conserva para el "
+ "próximo inicio."},
+ {"Popup Info (Ctrl+hover help)", "Popup Info (ayuda con Ctrl+pasar el ratón)"},
+ {"Popup Info", "Popup Info"},
+ {"Popup Info opacity", "Opacidad de Popup Info"},
+ {"Tooltip delay", "Retardo de las descripciones"},
+ {"One sub-palette open", "Una subpaleta abierta"},
+ {"Auto collapse left tray", "Plegar sola la bandeja izquierda"},
+ {"Auto collapse right tray", "Plegar sola la bandeja derecha"},
+ {"Palettes strictly A-Z (ZBrush order)", "Paletas de la A a la Z (orden de ZBrush)"},
+ {"Palettes strictly A-Z", "Paletas de la A a la Z"},
+ {"Left-handed layout", "Diseño para zurdos"},
+ {"Shelf tiles", "Fichas del estante"},
+ {"UI scale", "Escala de la interfaz"},
+ {"Automatic", "Automática"},
+ {"Rotation", "Rotación"},
+ {"Free (ZBrush)", "Libre (ZBrush)"},
+ {"Turntable", "Plataforma giratoria"},
+ {"Camera notch", "Muesca de la cámara"},
+ {"Always reserve", "Reservar siempre"},
+ {"Off", "Desactivado"},
+ {"Hold Ctrl and point at any control to see what it does and its shortcut. Ctrl+Alt shows a command's scripting "
+ "parameters.",
+ "Mantén Ctrl y apunta a cualquier control para ver qué hace y su atajo. Ctrl+Alt muestra los parámetros de "
+ "script del comando."},
+ {"How solid the Ctrl-help box is (ZBrush: Quick Info Opacity).",
+ "Lo opaca que es la ayuda de Ctrl (ZBrush: Quick Info Opacity)."},
+ {"How long to point at an icon-only button (or a clipped label) before its name appears.",
+ "Cuánto hay que apuntar a un botón de solo icono (o a una etiqueta cortada) antes de que aparezca su nombre."},
+ {"Opening a sub-palette closes the others in that palette. Shift+click opens more than one.",
+ "Abrir una subpaleta cierra las demás de esa paleta. Mayús+clic abre más de una."},
+ {"Opening a palette in the left tray collapses the others when they would not fit.",
+ "Abrir una paleta en la bandeja izquierda pliega las demás cuando no caben."},
+ {"Opening a palette in the right tray collapses the others when they would not fit.",
+ "Abrir una paleta en la bandeja derecha pliega las demás cuando no caben."},
+ {"Mirror the shelves and trays: tools on the left, navigation on the right.",
+ "Refleja los estantes y las bandejas: herramientas a la izquierda, navegación a la derecha."},
+ {"How big the brush tiles on the bottom shelf are. Small leaves the most room for the model.",
+ "El tamaño de las fichas de pinceles del estante inferior. Pequeño deja más sitio al modelo."},
+
+ // --- Preferences > Input ---
+ {"Style", "Estilo"},
+ {"ZBrush", "ZBrush"},
+ {"Blender", "Blender"},
+ {"Maya", "Maya"},
+ {"SculptForge", "SculptForge"},
+ {"Emulate Numpad", "Emular teclado numérico"},
+ {"Right click opens the QuickMenu", "El clic derecho abre el QuickMenu"},
+ {"Hold Space and drag to move the camera", "Mantén Espacio y arrastra para mover la cámara"},
+ {"Cursor follows surface", "El cursor sigue la superficie"},
+ {"Import Blender keymap", "Importar atajos de Blender"},
+ {"QuickMenu", "QuickMenu"},
+
+ // --- Preferences > Hotkeys ---
+ {"Filter", "Filtrar"},
+ {"press a key", "pulsa una tecla"},
+ {"Default shortcuts", "Atajos predeterminados"},
+
+ // --- Preferences > Display, LightBox, Tablet, Performance, Updates, Autosave ---
+ {"Show at startup", "Mostrar al iniciar"},
+ {"Show LightBox at startup", "Mostrar LightBox al iniciar"},
+ {"Placement", "Ubicación"},
+ {"Top", "Arriba"},
+ {"Bottom", "Abajo"},
+ {"Rows", "Filas"},
+ {"Library folder", "Carpeta de la biblioteca"},
+ {"Use the default folder", "Usar la carpeta predeterminada"},
+ {"Mouse & pen", "Ratón y lápiz"},
+ {"Mouse mode (relative)", "Modo ratón (relativo)"},
+ {"Mouse mode", "Modo ratón"},
+ {"Pressure curve", "Curva de presión"},
+ {"Pressure test", "Prueba de presión"},
+ {"Pressure meter", "Medidor de presión"},
+ {"Tablet defaults", "Valores predeterminados de la tableta"},
+ {"Tilt X %+.0f\xc2\xb0 Y %+.0f\xc2\xb0", "Inclinación X %+.0f\xc2\xb0 Y %+.0f\xc2\xb0"},
+ {"Min", "Mín."},
+ {"Max", "Máx."},
+ {"Minimum", "Mínimo"},
+ {"Maximum", "Máximo"},
+ {"Full at", "Completo a"},
+ {"Full pressure at", "Presión completa a"},
+ {"Curve", "Curva"},
+ {"Pen", "Lápiz"},
+ {"Keyboard", "Teclado"},
+ {"Bring the pen close to the tablet. Pressure works through the system's tablet driver.",
+ "Acerca el lápiz a la tableta. La presión funciona a través del controlador de la tableta del sistema."},
+ {"Bring the pen close to the tablet. Wacom: turn on \"Use Windows Ink\" in Wacom Tablet Properties > Mapping; "
+ "Huion / XP-Pen: enable Windows Ink in the driver.",
+ "Acerca el lápiz a la tableta. Wacom: activa \"Use Windows Ink\" en Propiedades de la tableta Wacom > Mapping; "
+ "Huion / XP-Pen: activa Windows Ink en el controlador."},
+ {"SpaceMouse (experimental)", "SpaceMouse (experimental)"},
+ {"Use SpaceMouse", "Usar SpaceMouse"},
+ {"SpaceMouse speed", "Velocidad del SpaceMouse"},
+ {"SpaceMouse defaults", "Valores predeterminados del SpaceMouse"},
+ {"Speed", "Velocidad"},
+ {"Dead zone", "Zona muerta"},
+ {"Dominant axis", "Eje dominante"},
+ {"Lock rotation to turntable", "Bloquear la rotación como plataforma giratoria"},
+ {"Plug it in. If 3DxWare is installed it may keep the device to itself: see the Navigation page of the guide.",
+ "Conéctalo. Si 3DxWare está instalado puede quedarse con el dispositivo: consulta la página Navegación de la "
+ "guía."},
+ {"Plug it in. SculptForge reads it as a joystick (/dev/input): you need read access to it, and spacenavd may hold "
+ "it. See the Navigation page of the guide.",
+ "Conéctalo. SculptForge lo lee como un joystick (/dev/input): necesitas permiso de lectura, y spacenavd puede "
+ "estar usándolo. Consulta la página Navegación de la guía."},
+ {"Antialiasing", "Antialiasing"},
+ {"Anti-aliasing", "Antialiasing"},
+ {"Fast Navigation", "Navegación rápida"},
+ {"Multithreading", "Multihilo"},
+ {"Predictive Strokes", "Trazos predictivos"},
+ {"Draft Strokes", "Trazos de borrador"},
+ {"%d threads", "%d hilos"},
+ {"Memory", "Memoria"},
+ {"Hardware profile", "Perfil de hardware"},
+ {"Frame Governor", "Regulador de fotogramas"},
+ {"Re-calibrate", "Recalibrar"},
+ {"Keep vertical sync on (frame rate capped at the display's)",
+ "Mantener la sincronización vertical (fotogramas limitados a los de la pantalla)"},
+ {"Every %d min", "Cada %d min"},
+ {"Autosave off", "Autoguardado desactivado"},
+ {"Save a recovery copy this often (0 = off). Restored after a crash.",
+ "Guarda una copia de recuperación con esta frecuencia (0 = desactivado). Se restaura tras un fallo."},
+
+ // --- LightBox ---
+ {"Image", "Imagen"},
+ {"Recent", "Recientes"},
+ {"Nothing here yet.", "Aún no hay nada."},
+ {"Nothing here yet. Projects you save (Ctrl+S) into the User folder show up here.",
+ "Aún no hay nada. Aquí aparecen los proyectos que guardas (Ctrl+S) en la carpeta User."},
+ {"Nothing here yet. QuickSave keeps timestamped copies of your scene here.",
+ "Aún no hay nada. QuickSave guarda aquí copias de tu escena con fecha y hora."},
+ {"Nothing here yet. Files you open show up here.", "Aún no hay nada. Aquí aparecen los archivos que abres."},
+ {"Nothing here yet. Put reference images in the User folder.",
+ "Aún no hay nada. Pon imágenes de referencia en la carpeta User."},
+ {"Nothing here yet. Put Gaussian splat captures (.ply, .splat) in the User folder.",
+ "Aún no hay nada. Pon capturas de Gaussian splats (.ply, .splat) en la carpeta User."},
+ {"Back", "Atrás"},
+ {"Forward", "Adelante"},
+ {"Open folder", "Abrir carpeta"},
+ {"Close LightBox", "Cerrar LightBox"},
+ {"Relief from image", "Relieve a partir de la imagen"},
+ {"Inflate image", "Inflar imagen"},
+ {"Project onto model", "Proyectar sobre el modelo"},
+ {"Use as alpha", "Usar como alpha"},
+ {"Use as Alpha", "Usar como alpha"},
+ {"Use as VDM", "Usar como VDM"},
+ {"Show in file manager", "Mostrar en el gestor de archivos"},
+ {"Refresh thumbnail", "Actualizar miniatura"},
+ {"Nothing here matches \"%s\".", "Aquí nada coincide con \"%s\"."},
+ {"LightBox rows", "Filas del LightBox"},
+ {"LightBox at the top", "LightBox arriba"},
+ {"LightBox at the bottom", "LightBox abajo"},
+ {"Show the items whose names contain this text.", "Muestra solo los elementos cuyo nombre contiene este texto."},
+ {"Show only the items whose names contain this text.", "Muestra solo los elementos cuyo nombre contiene este texto."},
+ {"The previous tab or folder.", "La pestaña o carpeta anterior."},
+ {"Forward again after going back.", "Adelante otra vez después de volver atrás."},
+ {"Hide the LightBox (comma toggles it).", "Oculta el LightBox (la coma lo muestra u oculta)."},
+ {"How many rows of thumbnails the LightBox shows (1-4).", "Cuántas filas de miniaturas muestra el LightBox (1-4)."},
+ {"Your projects (.sfproj) and recently opened projects.", "Tus proyectos (.sfproj) y los abiertos recientemente."},
+ {"Models to start from or append as SubTools: primitives and model files.",
+ "Modelos con los que empezar o que añadir como SubTools: primitivas y archivos de modelo."},
+ {"Every brush: built-in, custom and .sfbrush files in your library.",
+ "Todos los pinceles: de serie, personalizados y archivos .sfbrush de tu biblioteca."},
+ {"Brush alphas: built-in stamps and images in your Alphas folder.",
+ "Alphas de pincel: sellos de serie e imágenes de tu carpeta Alphas."},
+ {"Viewport materials: Studio and the MatCaps.", "Materiales de la vista: Studio y los MatCaps."},
+ {"Reference images: generate 3D, relief, inflate, project onto the model or use as an alpha.",
+ "Imágenes de referencia: genera 3D, relieve, infla, proyecta sobre el modelo o úsalas como alpha."},
+ {"Gaussian splat captures (.ply, .splat) to sculpt against.",
+ "Capturas de Gaussian splats (.ply, .splat) sobre las que esculpir."},
+ {"QuickSaves and the autosave, newest first.", "Los QuickSaves y el autoguardado, los más nuevos primero."},
+ {"Recently opened files of every kind.", "Archivos de todo tipo abiertos recientemente."},
+ {"Add a folder of your own to the LightBox (shown at the root of every tab).",
+ "Añade una carpeta tuya al LightBox (aparece en la raíz de cada pestaña)."},
+ {"Browse projects, models, brushes, alphas, materials, images and splats. Double-click to load; Shift+double-click "
+ "a model to append it as a SubTool; drag sideways to scrub.",
+ "Explora proyectos, modelos, pinceles, alphas, materiales, imágenes y splats. Doble clic para cargar; "
+ "Mayús+doble clic en un modelo para añadirlo como SubTool; arrastra a los lados para recorrerlos."},
+
+ // --- Pickers and brushes ---
+ {"Brush picker", "Selector de pinceles"},
+ {"Alpha picker", "Selector de alphas"},
+ {"Community brushes", "Pinceles de la comunidad"},
+ {"Save to Library", "Guardar en la biblioteca"},
+ {"Strength", "Fuerza"},
+ {"Falloff", "Atenuación"},
+ {"Name", "Nombre"},
+
+ // --- Common words and buttons ---
+ {"Apply", "Aplicar"},
+ {"Reset", "Restablecer"},
+ {"Preview", "Vista previa"},
+ {"Finish", "Terminar"},
+ {"Close", "Cerrar"},
+ {"OK", "Aceptar"},
+ {"Yes", "Sí"},
+ {"No", "No"},
+ {"Lock", "Bloquear"},
+ {"Live", "En vivo"},
+ {"Mean", "Media"},
+ {"Source", "Origen"},
+ {"Method", "Método"},
+ {"Weight", "Peso"},
+ {"Review", "Revisar"},
+ {"Network", "Red"},
+ {"Contents", "Contenido"},
+ {"Video", "Vídeo"},
+ {"Surface", "Superficie"},
+ {"World", "Mundo"},
+ {"Vertex", "Vértice"},
+ {"Front", "Frente"},
+ {"Rear", "Atrás"},
+ {"Sharpness", "Nitidez"},
+ {"Padding", "Margen"},
+ {"Map size", "Tamaño del mapa"},
+ {"Map Size", "Tamaño del mapa"},
+ {"Output folder", "Carpeta de salida"},
+ {"Output Folder", "Carpeta de salida"},
+ {"Open in browser", "Abrir en el navegador"},
+ {"Open Folder", "Abrir carpeta"},
+
+ // --- Project: unsaved changes, recovery, updates ---
+ {"Clear Recent", "Borrar recientes"},
+ {"Autosave (min)", "Autoguardado (min)"},
+ {"Save changes to %s before continuing?", "¿Guardar los cambios en %s antes de continuar?"},
+ {"Your changes will be lost if you don't save them.", "Si no los guardas, perderás los cambios."},
+ {"Don't Save", "No guardar"},
+ {"SculptForge did not close normally last time.", "SculptForge no se cerró correctamente la última vez."},
+ {"Restore the autosaved work?", "¿Restaurar el trabajo autoguardado?"},
+ {"What happened is in sculptforge-previous.log (Help > Open log folder);",
+ "Lo ocurrido está en sculptforge-previous.log (Ayuda > Abrir la carpeta de registros);"},
+ {"please attach it if you report the problem.", "adjúntalo si informas del problema."},
+ {"Restore", "Restaurar"},
+ {"Discard", "Descartar"},
+ {"SculptForge %s is available", "SculptForge %s está disponible"},
+ {"(you have %s)", "(tienes la %s)"},
+ {"What's new", "Novedades"},
+ {"Download", "Descargar"},
+ {"Later", "Más tarde"},
+ {"Skip this version", "Omitir esta versión"},
+ {"Checking", "Comprobando"},
+ {"This build gets its updates from your package manager.",
+ "Esta compilación se actualiza desde tu gestor de paquetes."},
+
+ // --- Sculpt Timeline ---
+ {"Sculpt Timeline", "Línea de tiempo de esculpido"},
+ {"Step %zu of %zu", "Paso %zu de %zu"},
+ {"Step %d: %s", "Paso %d: %s"},
+ {"Save with project", "Guardar con el proyecto"},
+ {"Start of the history", "Inicio del historial"},
+ {"Show the model here", "Mostrar aquí el modelo"},
+ {"Sculpting from an earlier step starts a branch;\nthe later steps stay as a lane above.",
+ "Esculpir desde un paso anterior inicia una rama;\nlos pasos posteriores quedan como un carril encima."},
+ {"The history of the active SubTool (%zu steps up to the cursor) played as a turntable.",
+ "El historial del SubTool activo (%zu pasos hasta el cursor) reproducido en plataforma giratoria."},
+ {"Length", "Duración"},
+ {"Rendering timelapse", "Renderizando timelapse"},
+
+ // --- Color, Polypaint, paint layers ---
+ {"Fill", "Rellenar"},
+ {"Fill layer", "Rellenar capa"},
+ {"Fill masked", "Rellenar enmascarado"},
+ {"Fill the unmasked area (the whole mesh if nothing is masked)",
+ "Rellena la zona sin máscara (toda la malla si no hay nada enmascarado)"},
+ {"Cavity", "Cavidad"},
+ {"Darken creases and cavities (respects the mask)", "Oscurece pliegues y cavidades (respeta la máscara)"},
+ {"Background", "Fondo"},
+ {"Shading", "Sombreado"},
+ {"Scene", "Escena"},
+ {"Colour", "Color"},
+ {"Base colour", "Color base"},
+ {"Paint brush (P)", "Pincel de pintura (P)"},
+ {"Paint into", "Pintar en"},
+ {"Paint layer", "Capa de pintura"},
+ {"Painting on: %s", "Pintando en: %s"},
+ {"Painting on: texture, %s", "Pintando en: textura, %s"},
+ {"Layer channel", "Canal de la capa"},
+ {"Channel view", "Vista de canal"},
+ {"RGB while sculpting", "RGB al esculpir"},
+ {"Sculpt brushes also paint the colour (ZBrush Rgb with Zadd)",
+ "Los pinceles de esculpir también pintan el color (Rgb con Zadd en ZBrush)"},
+ {"Min Opacity", "Opacidad mínima"},
+ {"+ Add", "+ Añadir"},
+ {"Group %d", "Grupo %d"},
+ {"Group", "Grupo"},
+ {"(Ctrl paints, Ctrl+Alt erases)", "(Ctrl pinta, Ctrl+Alt borra)"},
+ {"(Ctrl masks, Ctrl+Alt unmasks)", "(Ctrl enmascara, Ctrl+Alt desenmascara)"},
+
+ // --- More actions (shelves, QuickMenu, palettes) ---
+ {"Shelves", "Estantes"},
+ {"Frame", "Encuadrar"},
+ {"Draw Size at cursor", "Tamaño de dibujo en el cursor"},
+ {"Z Intensity at cursor", "Intensidad Z en el cursor"},
+ {"RGB Intensity at cursor", "Intensidad RGB en el cursor"},
+ {"Focal Shift at cursor", "Desplazamiento focal en el cursor"},
+ {"Last stroke", "Último trazo"},
+ {"To Surface", "A la superficie"},
+ {"Crop Box", "Recortar a la caja"},
+ {"Make Mesh", "Crear malla"},
+ {"Delete Last", "Eliminar la última"},
+ {"Make sculptable", "Hacer esculpible"},
+ {"Sculpt to Splats", "Esculpir a splats"},
+ {"Preview Normal Map", "Vista previa del mapa de normales"},
+ {"AA Off", "AA desactivado"},
+ {"AA 2x", "AA 2x"},
+ {"AA 4x", "AA 4x"},
+ {"AA 8x", "AA 8x"},
+ {"Store Config (Ctrl+Shift+I) keeps these settings.", "Store Config (Ctrl+Shift+I) conserva estos ajustes."},
+ {"Pan X", "Desplazar X"},
+ {"Pan Y", "Desplazar Y"},
+ {"Roll", "Balanceo"},
+ {"Tilt", "Inclinación"},
+ {"Spin", "Giro"},
+
+ // --- Extract, Project, Deformation ---
+ {"E Smt", "E Smt"},
+ {"PA Blur", "PA Blur"},
+ {"SubTools too", "También los SubTools"},
+ {"This SubTool", "Este SubTool"},
+ {"Move along normals", "Mover a lo largo de las normales"},
+ {"Mirror left and right", "Reflejar izquierda y derecha"},
+ {"Flip X", "Voltear X"},
+ {"Flip Y", "Voltear Y"},
+ {"Flip Z", "Voltear Z"},
+ {"Swap Y/Z", "Intercambiar Y/Z"},
+ {"Squash", "Aplastar"},
+ {"Fit plane", "Ajustar al plano"},
+ {"Edge Fade", "Atenuación del borde"},
+ {"Base Smoothing", "Suavizado de la base"},
+ {"All pieces", "Todas las piezas"},
+ {"Face loops", "Bucles de caras"},
+ {"Low-poly", "Low-poly"},
+ {"Base mesh", "Malla base"},
+
+ // --- Bake ---
+ {"Baking", "Haciendo bake"},
+ {"AO rays", "Rayos de AO"},
+ {"AO reach", "Alcance de AO"},
+ {"Auto distance", "Distancia automática"},
+ {"Max Frontal Distance", "Distancia frontal máx."},
+ {"Max Rear Distance", "Distancia trasera máx."},
+ {"Normal map convention", "Convención del mapa de normales"},
+ {"Export preset", "Preajuste de exportación"},
+ {"EXR displacement", "Desplazamiento EXR"},
+ {"UV view", "Vista UV"},
+
+ // --- Facial shapes, Make sculptable, phone, splats ---
+ {"Generate Facial Shapes", "Generar formas faciales"},
+ {"Record face take", "Grabar toma facial"},
+ {"Play Take", "Reproducir toma"},
+ {"Load Take", "Cargar toma"},
+ {"Bake Take", "Hacer bake de la toma"},
+ {"Clear Baked Take", "Borrar la toma con bake"},
+ {"Cancel Bake", "Cancelar bake"},
+ {"Take", "Toma"},
+ {"Live axes", "Ejes en vivo"},
+ {"Landmarks", "Puntos de referencia"},
+ {"Place Landmarks", "Colocar puntos de referencia"},
+ {"Auto Landmarks", "Puntos de referencia automáticos"},
+ {"Clear Landmarks", "Borrar puntos de referencia"},
+ {"Place by hand", "Colocar a mano"},
+ {"Good enough - stop", "Suficiente: parar"},
+ {"Try a test head", "Probar con una cabeza de prueba"},
+ {"Face test", "Prueba facial"},
+ {"From scan", "Desde el escaneo"},
+ {"Keep scan", "Conservar el escaneo"},
+ {"Generate from a photo at once", "Generar a partir de una foto de una vez"},
+ {"Capture from view", "Capturar desde la vista"},
+ {"Pairing code", "Código de emparejamiento"},
+ {"QR code", "Código QR"},
+ {"Unreal is on another computer", "Unreal está en otro ordenador"},
+ {"Receive automatically", "Recibir automáticamente"},
+ {"Update after each stroke", "Actualizar tras cada trazo"},
+ {"Record a video of the run (needs ffmpeg)", "Grabar un vídeo de la ejecución (necesita ffmpeg)"},
+ {"Choose Brush", "Elegir Brush"},
+ {"Choose COLMAP", "Elegir COLMAP"},
+ {"Photos Folder", "Carpeta de fotos"},
+ {"Find again", "Buscar de nuevo"},
+
+ // --- VDM, Kelvinlet, brush editing ---
+ {"Create VDM", "Crear VDM"},
+ {"Load VDM", "Cargar VDM"},
+ {"New VDM Plane", "Nuevo plano VDM"},
+ {"VDM name", "Nombre del VDM"},
+ {"Plane Res", "Res. del plano"},
+ {"Normal tilt", "Inclinación de la normal"},
+ {"Detail Clone", "Detail Clone"},
+ {"Clone Spacing", "Espaciado del clon"},
+ {"Clone follows stroke", "El clon sigue el trazo"},
+ {"Refine the selected brush", "Refinar el pincel seleccionado"},
+ {"Preset amount", "Cantidad del preajuste"},
+ {"preset amount", "cantidad del preajuste"},
+ {"Reset to 1", "Restablecer a 1"},
+ {"Scatter", "Dispersión"},
+ {"Loop", "Bucle"},
+ {"Letter index", "Índice de letra"},
+ {"Load image", "Cargar imagen"},
+ {"Invert loaded image", "Invertir la imagen cargada"},
+ {"Dark is high", "Oscuro es alto"},
+};
+
+} // namespace
+
+std::span<const Entry> spanishTable() { return {kSpanish, std::size(kSpanish)}; }
+
+} // namespace sf::i18n
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index 625eabef..eba9e40d 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -14,6 +14,7 @@
#include "app/BlenderKeymap.h"
#include "app/Pickers.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Polygroups.h"
#include <IconsLucide.h>
@@ -406,12 +407,12 @@ void App::drawInputStyleRow(float width) {
}
void App::drawInputSection() {
- ImGui::TextDisabled("Style");
+ ImGui::TextDisabled("%s", tr("Style"));
ImGui::SameLine();
drawInputStyleRow();
if (blenderStyle()) {
bool emulate = uiPrefs_.emulateNumpad;
- if (ImGui::Checkbox("Emulate Numpad", &emulate)) uiPrefs_.emulateNumpad = emulate;
+ if (ImGui::Checkbox(tr("Emulate Numpad"), &emulate)) uiPrefs_.emulateNumpad = emulate;
ui::HelpAction(*this, "input.emulate_numpad");
}
bool rightClickMenu = uiPrefs_.rightClickQuickMenu;
@@ -427,11 +428,12 @@ void App::drawInputSection() {
uiPrefs_.cursorFollowsSurface = surfaceCursor;
ui::HelpAction(*this, "input.surface_cursor");
ui::ActionButton(*this, "input.import_blender", ImVec2(-FLT_MIN, 0), ui::Look::IconLabel);
- ImGui::TextDisabled("Rotation");
+ ImGui::TextDisabled("%s", tr("Rotation"));
ImGui::SameLine();
int rotation = uiPrefs_.turntable ? 1 : 0;
ImGui::SetNextItemWidth(-1);
- if (ImGui::Combo("##rotation_input", &rotation, "Free (ZBrush)\0Turntable\0")) uiPrefs_.turntable = rotation == 1;
+ const std::string rotations = std::string(tr("Free (ZBrush)")) + '\0' + tr("Turntable") + '\0';
+ if (ImGui::Combo("##rotation_input", &rotation, rotations.c_str())) uiPrefs_.turntable = rotation == 1;
ui::HelpText("Rotation", nullptr,
"Free: the model turns about the screen's axes and can roll over the top, as in ZBrush. Turntable: it "
"stays upright, as in Blender or Maya.",
diff --git a/src/app/LightBox.cpp b/src/app/LightBox.cpp
index a19aa023..2f42a112 100644
--- a/src/app/LightBox.cpp
+++ b/src/app/LightBox.cpp
@@ -5,6 +5,7 @@
#include "app/App.h"
#include "app/Pickers.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Matcap.h"
#include "core/Primitives.h"
#include "core/Project.h"
@@ -468,24 +469,24 @@ void LightBox::contextMenu(App& app, const AssetEntry& e) {
const bool mesh = e.kind == AssetKind::Mesh || e.kind == AssetKind::Project || e.kind == AssetKind::Primitive;
if (ImGui::MenuItem(e.kind == AssetKind::Folder || e.kind == AssetKind::Up ? "Open folder" : "Open"))
activate(app, e, false);
- if (mesh && ImGui::MenuItem("Append as SubTool", "Shift+double-click")) activate(app, e, true);
+ if (mesh && ImGui::MenuItem(tr("Append as SubTool"), "Shift+double-click")) activate(app, e, true);
if (e.kind == AssetKind::Image) {
- if (ImGui::MenuItem("Generate 3D...")) app.openPath(e.path);
- if (ImGui::MenuItem("Relief from image"))
+ if (ImGui::MenuItem(tr("Generate 3D..."))) app.openPath(e.path);
+ if (ImGui::MenuItem(tr("Relief from image")))
app.confirmDiscard([&app, p = e.path] { app.runCommand("image_relief", {{"path", p}}); });
- if (ImGui::MenuItem("Inflate image"))
+ if (ImGui::MenuItem(tr("Inflate image")))
app.confirmDiscard([&app, p = e.path] { app.runCommand("image_inflate", {{"path", p}}); });
- if (ImGui::MenuItem("Project onto model")) app.runCommand("image_project", {{"path", e.path}});
- if (ImGui::MenuItem("Use as alpha"))
+ if (ImGui::MenuItem(tr("Project onto model"))) app.runCommand("image_project", {{"path", e.path}});
+ if (ImGui::MenuItem(tr("Use as alpha")))
app.runCommand("brush_set_alpha", {{"path", e.path}, {"invert", app.alphaInvert_}});
}
if (!e.path.empty() && e.kind != AssetKind::Up) {
ImGui::Separator();
- if (ImGui::MenuItem("Show in file manager")) {
+ if (ImGui::MenuItem(tr("Show in file manager"))) {
const std::string dir = e.kind == AssetKind::Folder ? e.path : utf8(fsPath(e.path).parent_path());
if (!SDL_OpenURL(("file://" + dir).c_str())) app.status_ = "Couldn't open " + dir + ": " + SDL_GetError();
}
- if (e.kind != AssetKind::Folder && ImGui::MenuItem("Refresh thumbnail")) app.thumbs_.refresh(e.path);
+ if (e.kind != AssetKind::Folder && ImGui::MenuItem(tr("Refresh thumbnail"))) app.thumbs_.refresh(e.path);
}
}
@@ -503,7 +504,7 @@ std::string LightBox::folderLabel(const App& app, const std::string& folder) con
void LightBox::drawBreadcrumb(App& app) {
// Tab > Built-in/User > sub > sub: each crumb goes back there.
std::vector<std::pair<std::string, Place>> crumbs;
- crumbs.push_back({libraryTabName(place_.tab), {place_.tab, ""}});
+ crumbs.push_back({tr(libraryTabName(place_.tab)), {place_.tab, ""}});
if (!place_.folder.empty()) {
const LibraryRoots& r = app.library_;
std::string top;
@@ -572,7 +573,7 @@ void LightBox::drawHeader(App& app, float width) {
ImGui::PushStyleColor(ImGuiCol_ButtonActive, IM_COL32(255, 255, 255, 30));
ImGui::PushStyleColor(ImGuiCol_Text,
on ? IM_COL32(255, 255, 255, 255) : ImGui::GetColorU32(ImGuiCol_TextDisabled));
- if (ImGui::Button(libraryTabName(tab)) && !on) navigate(app, {tab, ""});
+ if (ImGui::Button(tr(libraryTabName(tab))) && !on) navigate(app, {tab, ""});
ImGui::PopStyleColor(4);
if (on) {
const ImVec2 a = ImGui::GetItemRectMin(), b = ImGui::GetItemRectMax();
@@ -656,7 +657,7 @@ void LightBox::drawHeader(App& app, float width) {
ImGui::SameLine(0, 8 * scale);
}
ImGui::SetNextItemWidth(filterW);
- ImGui::InputTextWithHint("##lbfilter", ICON_LC_SEARCH " Filter", filter_, sizeof filter_);
+ ImGui::InputTextWithHint("##lbfilter", tr(ICON_LC_SEARCH " Filter"), filter_, sizeof filter_);
ui::HelpText("Filter", nullptr, "Show only the items whose names contain this text.", "LightBox");
ImGui::SameLine(0, 8 * scale);
for (int r = 1; r <= 4; ++r) {
@@ -862,9 +863,9 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
(items.empty() ? 8.0f : float((items.size() + size_t(rows) - 1) / size_t(rows)) * (tile + gap) + 12.0f);
ImGui::SetCursorScreenPos(ImVec2(x, base.y + 4.0f * scale + tile * 0.5f - ImGui::GetTextLineHeight() * 0.5f));
if (hint)
- ImGui::TextDisabled("%s", hint);
+ ImGui::TextDisabled("%s", tr(hint));
else
- ImGui::TextDisabled("Nothing here matches \"%s\".", filter_);
+ ImGui::TextDisabled(tr("Nothing here matches \"%s\"."), filter_);
}
AssetTileHoverGlow();
ImGui::EndChild();
@@ -881,16 +882,16 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
ImGui::Separator();
bool done = false;
if (ImGui::MenuItem(ICON_LC_SPARKLES " Generate 3D...")) app.openPath(e.path), done = true;
- if (ImGui::MenuItem("Relief from image")) {
+ if (ImGui::MenuItem(tr("Relief from image"))) {
app.confirmDiscard([&app, p = e.path] { app.runCommand("image_relief", {{"path", p}}); });
done = true;
}
- if (ImGui::MenuItem("Inflate image")) {
+ if (ImGui::MenuItem(tr("Inflate image"))) {
app.confirmDiscard([&app, p = e.path] { app.runCommand("image_inflate", {{"path", p}}); });
done = true;
}
- if (ImGui::MenuItem("Project onto model")) app.runCommand("image_project", {{"path", e.path}}), done = true;
- if (ImGui::MenuItem("Use as alpha"))
+ if (ImGui::MenuItem(tr("Project onto model"))) app.runCommand("image_project", {{"path", e.path}}), done = true;
+ if (ImGui::MenuItem(tr("Use as alpha")))
app.runCommand("brush_set_alpha", {{"path", e.path}, {"invert", app.alphaInvert_}}), done = true;
if (done) imageMenu_.clear();
ImGui::EndPopup();
@@ -919,7 +920,7 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
void LightBox::drawPreferences(App& app) {
UiLayout& layout = app.layout_;
- ImGui::Checkbox("Show at startup##lightbox", &showAtStartup);
+ ImGui::Checkbox(tr("Show at startup##lightbox"), &showAtStartup);
ui::HelpText("Show at startup", nullptr,
"Open the LightBox on the Project tab when SculptForge starts (as ZBrush does).",
"Preferences > LightBox");
@@ -927,14 +928,14 @@ void LightBox::drawPreferences(App& app) {
ImGui::SliderInt("##lbrowspref", &layout.lightboxRows, 1, 4, "Rows %d");
ui::HelpText("Rows", nullptr, "Rows of thumbnails in the LightBox strip.", "Preferences > LightBox");
int placement = layout.lightboxBottom ? 1 : 0;
- ImGui::TextUnformatted("Placement");
+ ImGui::TextUnformatted(tr("Placement"));
ImGui::SameLine();
- if (ImGui::RadioButton("Top##lbplace", placement == 0)) layout.lightboxBottom = false;
+ if (ImGui::RadioButton(tr("Top##lbplace"), placement == 0)) layout.lightboxBottom = false;
ImGui::SameLine();
- if (ImGui::RadioButton("Bottom##lbplace", placement == 1)) layout.lightboxBottom = true;
+ if (ImGui::RadioButton(tr("Bottom##lbplace"), placement == 1)) layout.lightboxBottom = true;
ui::HelpText("Placement", nullptr, "Show the LightBox along the top or the bottom of the canvas.",
"Preferences > LightBox");
- ImGui::TextDisabled("Library folder");
+ ImGui::TextDisabled("%s", tr("Library folder"));
ImGui::TextWrapped("%s", app.library_.user.empty() ? "(none)" : app.library_.user.c_str());
if (!app.library_.user.empty() && ImGui::Button(ICON_LC_FOLDER_OPEN " Show library folder"))
SDL_OpenURL(("file://" + app.library_.user).c_str());
diff --git a/src/app/Palettes.cpp b/src/app/Palettes.cpp
index a9f645a3..d6f89c73 100644
--- a/src/app/Palettes.cpp
+++ b/src/app/Palettes.cpp
@@ -14,6 +14,7 @@
#include "app/Shell.h"
#include "app/Theme.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Matcap.h"
#include <IconsLucide.h>
@@ -95,7 +96,7 @@ void menuAction(App& app, const char* id) {
const std::string shortcut = app.actions().shortcutText(id);
const bool enabled = !a->enabled || a->enabled();
const bool checked = a->checked && a->checked();
- const std::string label = a->label + "##" + a->id; // no icons: they'd misalign with the plain project items
+ const std::string label = std::string(trAction(a->id, a->label)) + "##" + a->id; // no icons: they'd misalign with the plain project items
if (ImGui::MenuItem(label.c_str(), shortcut.empty() ? nullptr : shortcut.c_str(), checked, enabled) && a->run) {
app.actions().touch(a->id);
a->run();
@@ -107,7 +108,7 @@ void menuAction(App& app, const char* id) {
void hint(const App& app, const char* text) {
if (app.smallFont()) ImGui::PushFont(app.smallFont());
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled));
- ImGui::TextWrapped("%s", text);
+ ImGui::TextWrapped("%s", tr(text));
ImGui::PopStyleColor();
if (app.smallFont()) ImGui::PopFont();
}
@@ -146,7 +147,7 @@ void GroupLabel(const App& app, const char* text) {
ImGui::PushStyleColor(ImGuiCol_Separator, ImGui::ColorConvertU32ToFloat4(kSectionRule));
ImGui::PushStyleVar(ImGuiStyleVar_SeparatorTextPadding, ImVec2(0.0f, 2.0f * s));
ImGui::PushStyleVar(ImGuiStyleVar_SeparatorTextAlign, ImVec2(0.0f, 0.5f));
- ImGui::SeparatorText(text);
+ ImGui::SeparatorText(tr(text));
ImGui::PopStyleVar(2);
ImGui::PopStyleColor(2);
if (app.smallFont()) ImGui::PopFont();
@@ -166,7 +167,8 @@ bool SliderInt(const char* id, int* v, int lo, int hi, const char* format, ImGui
} // namespace tray
-bool App::subpalette(const char* id, const char* title) {
+bool App::subpalette(const char* id, const char* englishTitle) {
+ const char* title = tr(englishTitle); // the interface language (I18n.h); the id keeps the item's identity
auto& open = layout_.openSubpalettes;
bool isOpen = std::find(open.begin(), open.end(), id) != open.end();
const float s = uiScale_;
@@ -225,12 +227,12 @@ void App::drawPalette_Brush() {
actionRow(*this, {"ui.brush_lab", "ui.brush_gallery"});
actionRow(*this, {"brush.paste"});
drawCustomBrushes();
- ImGui::Checkbox("Front faces only", &frontFacesOnly_);
+ ImGui::Checkbox(tr("Front faces only"), &frontFacesOnly_);
ui::HelpAction(*this, "draw.front_faces");
ImGui::SameLine();
- ImGui::Checkbox("Invert (Alt)", &invertToggle_);
+ ImGui::Checkbox(tr("Invert (Alt)"), &invertToggle_);
ui::HelpText("Invert", "Alt", "Brushes subtract instead of add (ZBrush Zsub). Holding Alt flips it for one stroke.", "Brush");
- ImGui::Checkbox("Smooth keeps volume##smooth_keep_volume", &smoothKeepVolume_);
+ ImGui::Checkbox(tr("Smooth keeps volume##smooth_keep_volume"), &smoothKeepVolume_);
ui::HelpText("Smooth keeps volume", nullptr,
"The Smooth brush (and Shift) removes bumps without shrinking the form, instead of the plain smooth "
"that also flattens it. Either way, let go of Shift while still pressing a Shift-smooth stroke to "
@@ -239,7 +241,7 @@ void App::drawPalette_Brush() {
if (BrushRecipe* recipe = doc_.activeBrush >= 0 && doc_.activeBrush < int(doc_.brushes.size())
? &doc_.brushes[size_t(doc_.activeBrush)]
: nullptr) {
- if (subpalette("brush.recipe", ("Edit recipe: " + recipe->name).c_str())) {
+ if (subpalette("brush.recipe", (std::string(tr("Edit recipe:")) + " " + recipe->name).c_str())) {
tray::Section section;
drawRecipeEditor(*recipe);
if (!pendingRename_.empty()) {
@@ -335,8 +337,8 @@ void App::drawPalette_Draw() {
}
void App::drawPalette_Edit() {
- const std::string undoText = doc_.undo.canUndo() ? "Undo " + doc_.undo.undoLabel() : std::string("Undo");
- const std::string redoText = doc_.undo.canRedo() ? "Redo " + doc_.undo.redoLabel() : std::string("Redo");
+ const std::string undoText = doc_.undo.canUndo() ? std::string(tr("Undo")) + " " + doc_.undo.undoLabel() : std::string(tr("Undo"));
+ const std::string redoText = doc_.undo.canRedo() ? std::string(tr("Redo")) + " " + doc_.undo.redoLabel() : std::string(tr("Redo"));
ImGui::BeginDisabled(!doc_.undo.canUndo());
if (ImGui::MenuItem((undoText + "##edit.undo").c_str(), "Ctrl+Z")) runCommand("undo");
ImGui::EndDisabled();
@@ -389,21 +391,21 @@ void App::drawPalette_Generate() {
ui::HelpText("Choose image", nullptr, "A sketch, concept, logo, photo or height map (or drop one on the window).", "Generate");
ImGui::BeginDisabled(refImage_.empty());
const float third = (ImGui::GetContentRegionAvail().x - 2.0f * ImGui::GetStyle().ItemSpacing.x) / 3.0f;
- if (ImGui::Button("Relief", ImVec2(third, 0)))
+ if (ImGui::Button(tr("Relief"), ImVec2(third, 0)))
runCommand("image_relief", {{"path", refImagePath_},
{"depth", double(reliefDepth_)},
{"resolution", double(reliefDetail_)},
{"invert", reliefInvert_}});
ui::HelpText("Relief", nullptr, "Light areas rise: logos, coins, emblems, height maps.", "Generate");
ImGui::SameLine();
- if (ImGui::Button("Inflate", ImVec2(third, 0)))
+ if (ImGui::Button(tr("Inflate"), ImVec2(third, 0)))
runCommand("image_inflate", {{"path", refImagePath_},
{"thickness", double(inflateThickness_)},
{"resolution", double(inflateDetail_)},
{"subdivisions", 2.0}});
ui::HelpText("Inflate", nullptr, "Inflates the outline into a rounded blockout.", "Generate");
ImGui::SameLine();
- if (ImGui::Button("Stamp", ImVec2(third, 0))) projectImageFromView();
+ if (ImGui::Button(tr("Stamp"), ImVec2(third, 0))) projectImageFromView();
ui::HelpText("Stamp", nullptr, "Projects the image onto the model from this view as surface detail.", "Generate");
ImGui::EndDisabled();
if (subpalette("generate.ai", "AI brush provider")) {
@@ -434,7 +436,7 @@ void App::drawPalette_Preferences() {
if (subpalette("preferences.config", "Config")) {
tray::Section section;
config::drawConfigSection(*this);
- ImGui::TextDisabled("Layout");
+ ImGui::TextDisabled("%s", tr("Layout"));
for (int i = 1; i <= 3; ++i) {
ImGui::SameLine();
ui::ActionButton(*this, ("ui.preset." + std::to_string(i)).c_str(), ImVec2(ImGui::GetFrameHeight() * 1.4f, 0));
@@ -484,18 +486,18 @@ void App::drawPalette_Preferences() {
void App::drawPalette_Render() {
const tray::Style style; // quiet check marks
- ImGui::Checkbox("Wireframe", &renderSettings_.wireframe);
+ ImGui::Checkbox(tr("Wireframe"), &renderSettings_.wireframe);
ui::HelpAction(*this, "view.wireframe");
- ImGui::Checkbox("Show Mesh", &renderSettings_.showMesh);
+ ImGui::Checkbox(tr("Show Mesh"), &renderSettings_.showMesh);
ui::HelpAction(*this, "view.mesh");
- ImGui::Checkbox("Show Polypaint", &renderSettings_.showPolypaint);
+ ImGui::Checkbox(tr("Show Polypaint"), &renderSettings_.showPolypaint);
ui::HelpAction(*this, "view.polypaint");
- ImGui::Checkbox("Show Mask", &renderSettings_.showMask);
+ ImGui::Checkbox(tr("Show Mask"), &renderSettings_.showMask);
ui::HelpAction(*this, "view.mask");
- ImGui::Checkbox("Show Polygroups##render", &renderSettings_.showPolygroups);
+ ImGui::Checkbox(tr("Show Polygroups##render"), &renderSettings_.showPolygroups);
ui::HelpAction(*this, "view.polygroups");
ImGui::BeginDisabled(doc_.splats.empty());
- ImGui::Checkbox("Show Splats", &renderSettings_.showSplats);
+ ImGui::Checkbox(tr("Show Splats"), &renderSettings_.showSplats);
ImGui::EndDisabled();
ui::HelpAction(*this, "view.splats");
drawBackgroundControls("render");
@@ -585,7 +587,7 @@ void App::drawPalette_Tool() {
drawGeometrySection();
actionRow(*this, {"geometry.subdivide"});
const float half = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
- if (ImGui::Button("Decimate", ImVec2(half, 0))) {
+ if (ImGui::Button(tr("Decimate"), ImVec2(half, 0))) {
Args args{{"ratio", double(decimateRatio_)}};
if (decimateKeepMasked_) args["keep_masked"] = true;
runCommand("decimate", args);
@@ -596,7 +598,7 @@ void App::drawPalette_Tool() {
ImGui::SetNextItemWidth(-1);
ui::SliderInside("##decimate", &decimateRatio_, 0.05f, 0.95f, "Keep %.2f");
ui::HelpText("Keep", nullptr, "Fraction of the triangles Decimate keeps.", "Tool > Geometry");
- ImGui::Checkbox("Keep Masked##decimate", &decimateKeepMasked_);
+ ImGui::Checkbox(tr("Keep Masked##decimate"), &decimateKeepMasked_);
ui::HelpText("Keep Masked", nullptr,
"Decimate leaves masked vertices where they are, so masked areas keep their triangles exactly; "
"the rest is decimated around them.",
@@ -632,10 +634,10 @@ void App::drawPalette_Tool() {
ui::HelpText("Resolution", nullptr, "Voxels across the model: higher keeps more detail and makes more triangles.",
"Tool > Remesh");
if (voxelRemesh_) {
- if (ImGui::Button("Cancel##voxelremesh", ImVec2(half, 0))) voxelRemesh_->cancel->store(true);
+ if (ImGui::Button(tr("Cancel##voxelremesh"), ImVec2(half, 0))) voxelRemesh_->cancel->store(true);
ui::HelpText("Cancel", nullptr, "Stop the remesh; the SubTool stays as it is.", "Tool > Remesh");
} else {
- ImGui::Checkbox("Keep Masked##remesh", &voxelKeepMasked_);
+ ImGui::Checkbox(tr("Keep Masked##remesh"), &voxelKeepMasked_);
ui::HelpText("Keep Masked", nullptr, kKeepMaskedHelp, "Tool > Remesh");
if (hasTexture(doc_.mesh)) {
ImGui::SameLine();
@@ -669,15 +671,15 @@ void App::drawPalette_Tool() {
}
if (subpalette("tool.display", "Display")) {
tray::Section section;
- ImGui::Checkbox("Wireframe##display", &renderSettings_.wireframe);
+ ImGui::Checkbox(tr("Wireframe##display"), &renderSettings_.wireframe);
ui::HelpAction(*this, "view.wireframe");
ImGui::SameLine();
- ImGui::Checkbox("Mask##display", &renderSettings_.showMask);
+ ImGui::Checkbox(tr("Mask##display"), &renderSettings_.showMask);
ui::HelpAction(*this, "view.mask");
ImGui::SameLine();
- ImGui::Checkbox("Groups##display", &renderSettings_.showPolygroups);
+ ImGui::Checkbox(tr("Groups##display"), &renderSettings_.showPolygroups);
ui::HelpAction(*this, "view.polygroups");
- ImGui::ColorEdit3("Material colour", &renderSettings_.baseColor.x, ImGuiColorEditFlags_NoInputs);
+ ImGui::ColorEdit3(tr("Material colour"), &renderSettings_.baseColor.x, ImGuiColorEditFlags_NoInputs);
ui::HelpText("Material colour", nullptr, "Colour of the Studio material (the clay colour).", "Tool > Display");
drawShadingControls();
}
@@ -685,9 +687,9 @@ void App::drawPalette_Tool() {
void App::drawPalette_Transform() {
const tray::Style style; // quiet check marks
- ImGui::TextDisabled("Gizmo 3D");
+ ImGui::TextDisabled("%s", tr("Gizmo 3D"));
drawGizmoContents(false);
- ImGui::TextDisabled("Symmetry");
+ ImGui::TextDisabled("%s", tr("Symmetry"));
segmented(*this, {"transform.symmetry_x", "transform.symmetry_y", "transform.symmetry_z"});
actionRow(*this, {"view.frame", "subtool.solo"});
actionRow(*this, {"view.polyf"});
diff --git a/src/app/PanelBlender.cpp b/src/app/PanelBlender.cpp
index a86ce149..b57e8184 100644
--- a/src/app/PanelBlender.cpp
+++ b/src/app/PanelBlender.cpp
@@ -4,6 +4,7 @@
// File > Blender: the bridge to the SculptForge add-on for Blender (io/BlenderBridge.h, addons/blender).
// Blender writes to_sculptforge/manifest.json; this polls it once a second and loads each new revision.
#include "app/App.h"
+#include "app/I18n.h"
#include "app/Ui.h"
#include "io/BlenderBridge.h"
@@ -49,7 +50,7 @@ void menuAction(App& app, const char* id) {
const Action* a = app.actions().find(id);
if (!a) return;
const std::string shortcut = app.actions().shortcutText(id);
- const std::string label = a->label + "##" + a->id;
+ const std::string label = std::string(trAction(a->id, a->label)) + "##" + a->id;
if (ImGui::MenuItem(label.c_str(), shortcut.empty() ? nullptr : shortcut.c_str(), false, !a->enabled || a->enabled()) &&
a->run) {
app.actions().touch(a->id);
diff --git a/src/app/PanelGeometry.cpp b/src/app/PanelGeometry.cpp
index e7b95404..f6e3479b 100644
--- a/src/app/PanelGeometry.cpp
+++ b/src/app/PanelGeometry.cpp
@@ -5,6 +5,7 @@
// Reconstruct Subdiv, Divide with Smt). The levels themselves live in core/Multires.
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Micro.h"
#include "core/Multires.h"
@@ -61,7 +62,7 @@ void App::drawGeometrySection() {
subdivLevelTriangles(m, 0), subdivLevelTriangles(m, levels - 1));
ImGui::TextDisabled("%s", info);
} else {
- ImGui::TextDisabled("No subdivision levels - Divide adds them");
+ ImGui::TextDisabled("%s", tr("No subdivision levels - Divide adds them"));
}
// Micro: displacement levels above the highest level (core/Micro.h). One row: the level slider and Divide to
@@ -94,7 +95,7 @@ void App::drawGeometrySection() {
ui::ActionButton(*this, "geometry.micro_delete", ImVec2(-1, 0));
ui::ActionButton(*this, "geometry.micro_export", ImVec2(half, 0));
ImGui::SameLine();
- ImGui::Checkbox("Move along normals", &doc_.sculptor.microMoveAlongNormals);
+ ImGui::Checkbox(tr("Move along normals"), &doc_.sculptor.microMoveAlongNormals);
}
if (micro && m.micro) { // (a button above may have just removed it)
const MicroMesh& mm = *m.micro;
diff --git a/src/app/PanelMasking.cpp b/src/app/PanelMasking.cpp
index 75462131..487c5133 100644
--- a/src/app/PanelMasking.cpp
+++ b/src/app/PanelMasking.cpp
@@ -9,6 +9,7 @@
#include "app/Palettes.h"
#include "app/Pickers.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include <IconsLucide.h>
@@ -167,10 +168,10 @@ bool App::drawHeldBrushGrid(HeldBrush held, bool strokes) {
}
void App::drawMaskingSection() {
- ImGui::Checkbox("Show mask", &renderSettings_.showMask);
+ ImGui::Checkbox(tr("Show mask"), &renderSettings_.showMask);
ImGui::SameLine();
- ImGui::TextDisabled(maskShape_ == SelectShape::Pen ? "(Ctrl paints, Ctrl+Alt erases)"
- : "(Ctrl masks, Ctrl+Alt unmasks)");
+ ImGui::TextDisabled("%s", tr(maskShape_ == SelectShape::Pen ? "(Ctrl paints, Ctrl+Alt erases)"
+ : "(Ctrl masks, Ctrl+Alt unmasks)"));
ui::Segmented(*this, {"mask.pen", "mask.lasso", "mask.rect"});
ImGui::SetNextItemWidth(-1);
ui::SliderInside("##maskstrength", &maskStrength_, 0.01f, 1.0f, "Mask Strength %.2f");
@@ -178,38 +179,38 @@ void App::drawMaskingSection() {
const ImGuiStyle& style = ImGui::GetStyle();
const float third = (ImGui::GetContentRegionAvail().x - 2 * style.ItemSpacing.x) / 3.0f;
const float half = (ImGui::GetContentRegionAvail().x - style.ItemSpacing.x) * 0.5f;
- if (ImGui::Button("Clear##mask", ImVec2(third, 0))) runCommand("mask_clear");
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Unmask everything (MaskPen: Ctrl + drag background)");
+ if (ImGui::Button(tr("Clear##mask"), ImVec2(third, 0))) runCommand("mask_clear");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Unmask everything (MaskPen: Ctrl + drag background)"));
ImGui::SameLine();
- if (ImGui::Button("Invert##mask", ImVec2(third, 0))) runCommand("mask_invert");
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Ctrl + click background");
+ if (ImGui::Button(tr("Invert##mask"), ImVec2(third, 0))) runCommand("mask_invert");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Ctrl + click background"));
ImGui::SameLine();
- if (ImGui::Button("All##mask", ImVec2(third, 0))) runCommand("mask_all");
+ if (ImGui::Button(tr("All##mask"), ImVec2(third, 0))) runCommand("mask_all");
const Args passes = {{"iterations", double(maskIterations_)}};
- if (ImGui::Button("Blur##mask", ImVec2(half, 0))) runCommand("mask_blur", passes);
+ if (ImGui::Button(tr("Blur##mask"), ImVec2(half, 0))) runCommand("mask_blur", passes);
ImGui::SameLine();
- if (ImGui::Button("Sharpen##mask", ImVec2(half, 0))) runCommand("mask_sharpen", passes);
- if (ImGui::Button("Grow##mask", ImVec2(half, 0))) runCommand("mask_grow", passes);
+ if (ImGui::Button(tr("Sharpen##mask"), ImVec2(half, 0))) runCommand("mask_sharpen", passes);
+ if (ImGui::Button(tr("Grow##mask"), ImVec2(half, 0))) runCommand("mask_grow", passes);
ImGui::SameLine();
- if (ImGui::Button("Shrink##mask", ImVec2(half, 0))) runCommand("mask_shrink", passes);
+ if (ImGui::Button(tr("Shrink##mask"), ImVec2(half, 0))) runCommand("mask_shrink", passes);
ImGui::SetNextItemWidth(-1);
tray::SliderInt("##maskpasses", &maskIterations_, 1, 20, "Passes %d");
- if (ImGui::Button("By cavity", ImVec2(half, 0)))
+ if (ImGui::Button(tr("By cavity"), ImVec2(half, 0)))
runCommand("mask_by_cavity", {{"strength", double(maskStrength_)}, {"threshold", double(cavityThreshold_)}});
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Mask creases and folds (replaces the mask; uses the mask strength)");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Mask creases and folds (replaces the mask; uses the mask strength)"));
ImGui::SameLine();
ImGui::SetNextItemWidth(-1);
ui::SliderInside("##cavitythreshold", &cavityThreshold_, -0.2f, 0.5f, "Threshold %.2f");
- if (ImGui::Button("By polygroup", ImVec2(half, 0)))
+ if (ImGui::Button(tr("By polygroup"), ImVec2(half, 0)))
runCommand("mask_by_polygroup", {{"group", double(maskGroup_)}});
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Mask one polygroup (replaces the mask)");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Mask one polygroup (replaces the mask)"));
ImGui::SameLine();
// The group id as a drag field the size of the button beside it (Ctrl+click or double-click types a number),
// rather than an input with tiny - and + buttons.
ImGui::SetNextItemWidth(-1);
- if (ImGui::DragInt("##maskgroup", &maskGroup_, 0.1f, 0, 1 << 30, "Group %d", ImGuiSliderFlags_AlwaysClamp))
+ if (ImGui::DragInt("##maskgroup", &maskGroup_, 0.1f, 0, 1 << 30, tr("Group %d"), ImGuiSliderFlags_AlwaysClamp))
maskGroup_ = std::max(0, maskGroup_);
}
diff --git a/src/app/PanelPaintLayers.cpp b/src/app/PanelPaintLayers.cpp
index 6bbae751..773947bb 100644
--- a/src/app/PanelPaintLayers.cpp
+++ b/src/app/PanelPaintLayers.cpp
@@ -13,6 +13,7 @@
// shows and edits the texture's layers (the commands hand over to it).
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/PaintLayer.h"
#include "core/Polypaint.h"
@@ -100,7 +101,7 @@ void App::drawPaintLayersContents() {
const int count = int(rows.size());
if (hasTexture(mesh)) {
ImGui::AlignTextToFramePadding();
- ImGui::TextDisabled("Paint into");
+ ImGui::TextDisabled("%s", tr("Paint into"));
ImGui::SameLine();
ui::Segmented(*this, {"draw.paint_vertex", "draw.paint_texture"});
}
@@ -173,15 +174,15 @@ void App::drawPaintLayersContents() {
}
if (ImGui::BeginPopupContextItem("##row")) {
ImGui::TextDisabled("%s", name.c_str());
- if (ImGui::MenuItem("Rename", nullptr, false, l != nullptr)) {
+ if (ImGui::MenuItem(tr("Rename"), nullptr, false, l != nullptr)) {
renamingPaintLayer_ = i;
focusPaintRename_ = true;
std::snprintf(paintRenameBuffer_, sizeof paintRenameBuffer_, "%s", name.c_str());
}
- if (ImGui::MenuItem("Duplicate")) duplicateIndex = i;
- if (ImGui::MenuItem("Merge down", nullptr, false, l != nullptr)) mergeIndex = i;
- if (ImGui::MenuItem("Clear")) clearIndex = i;
- if (ImGui::MenuItem("Delete", nullptr, false, l != nullptr)) deleteIndex = i;
+ if (ImGui::MenuItem(tr("Duplicate"))) duplicateIndex = i;
+ if (ImGui::MenuItem(tr("Merge down"), nullptr, false, l != nullptr)) mergeIndex = i;
+ if (ImGui::MenuItem(tr("Clear"))) clearIndex = i;
+ if (ImGui::MenuItem(tr("Delete"), nullptr, false, l != nullptr)) deleteIndex = i;
ImGui::EndPopup();
}
}
@@ -289,12 +290,12 @@ void App::drawPaintLayersContents() {
ui::HelpText("New paint layer", nullptr, "Add a transparent paint layer above the active one and paint on it.", kPath);
ImGui::SameLine();
ImGui::BeginDisabled(mesh.vertexCount() == 0);
- if (ImGui::Button("Duplicate##paint", ImVec2(third, 0))) runCommand("paint_layer_duplicate");
+ if (ImGui::Button(tr("Duplicate##paint"), ImVec2(third, 0))) runCommand("paint_layer_duplicate");
ImGui::EndDisabled();
ui::HelpText("Duplicate", nullptr, "Copy the active layer (Base becomes an opaque layer) to a new layer above it.", kPath);
ImGui::SameLine();
ImGui::BeginDisabled(!cur);
- if (ImGui::Button("Delete##paint", ImVec2(third, 0))) runCommand("paint_layer_delete");
+ if (ImGui::Button(tr("Delete##paint"), ImVec2(third, 0))) runCommand("paint_layer_delete");
ImGui::EndDisabled();
ui::HelpText("Delete", nullptr, "Delete the active layer (undoable). Base can't be deleted.", kPath);
@@ -311,13 +312,13 @@ void App::drawPaintLayersContents() {
ui::HelpText("Move down", nullptr, "Move the active layer down the stack (Base stays at the bottom).", kPath);
ImGui::SameLine();
ImGui::BeginDisabled(!cur);
- if (ImGui::Button("Merge down##paint", ImVec2(rest, 0))) runCommand("paint_layer_merge");
+ if (ImGui::Button(tr("Merge down##paint"), ImVec2(rest, 0))) runCommand("paint_layer_merge");
ImGui::EndDisabled();
ui::HelpText("Merge down", nullptr,
"Merge the active layer into the one below it (Base for the lowest layer), keeping how it looks.", kPath);
ImGui::SameLine();
ImGui::BeginDisabled(stackSize == 0);
- if (ImGui::Button("Flatten##paint", ImVec2(-1, 0))) runCommand("paint_layer_flatten");
+ if (ImGui::Button(tr("Flatten##paint"), ImVec2(-1, 0))) runCommand("paint_layer_flatten");
ImGui::EndDisabled();
ui::HelpText("Flatten", nullptr, "Bake every visible layer into Base and remove the layers (hidden layers are discarded).",
kPath);
@@ -328,7 +329,7 @@ void App::drawPaintLayersContents() {
ui::HelpText("Clear", nullptr, "Clear the active layer: a layer becomes transparent, Base white. Undoable.", kPath);
ImGui::SameLine();
ImGui::BeginDisabled(mesh.vertexCount() == 0 || (cur && (cur->locked || !cur->visible)));
- if (ImGui::Button("Fill layer", ImVec2(-1, 0))) runCommand("paint_fill", {{"color", colorToHex(doc_.paintColor)}});
+ if (ImGui::Button(tr("Fill layer"), ImVec2(-1, 0))) runCommand("paint_fill", {{"color", colorToHex(doc_.paintColor)}});
ImGui::EndDisabled();
ui::HelpText("Fill", nullptr, "Fill the active layer with the current colour (respects the mask, like Color > Fill).",
kPath);
diff --git a/src/app/PanelPerformance.cpp b/src/app/PanelPerformance.cpp
index 3b281950..f893202f 100644
--- a/src/app/PanelPerformance.cpp
+++ b/src/app/PanelPerformance.cpp
@@ -6,6 +6,7 @@
// numbers come from the same instruments as the benchmark (core/Benchmark.h, docs/performance.md).
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Benchmark.h"
#include "core/HardwareProfile.h"
@@ -153,34 +154,34 @@ void App::notePerformanceFrame(double syncMs) {
void App::drawPerformanceSection() {
drawPerformanceProfileSection(); // what was detected and measured, the profile, overrides (PanelPerformanceProfile.cpp)
// --- The 3D view ---
- ImGui::TextUnformatted("Antialiasing");
+ ImGui::TextUnformatted(tr("Antialiasing"));
ui::HelpText("Antialiasing", nullptr,
"Samples per pixel in the 3D view: more smooths edges, fewer is faster on huge meshes.", kPath);
ui::Segmented(*this, {"perf.aa_1", "perf.aa_2", "perf.aa_4", "perf.aa_8"});
bool fast = uiPrefs_.fastNavigation;
- if (ImGui::Checkbox("Fast Navigation", &fast)) actions_.find("perf.fast_navigation")->run();
+ if (ImGui::Checkbox(tr("Fast Navigation"), &fast)) actions_.find("perf.fast_navigation")->run();
ui::HelpAction(*this, "perf.fast_navigation");
if (perf_.samplesUsed > 0 && perf_.samplesUsed < uiPrefs_.antialiasing && !perf_.fastNow)
dimText("The GPU had no room for " + std::to_string(uiPrefs_.antialiasing) + "x: using " +
(perf_.samplesUsed == 1 ? std::string("none") : std::to_string(perf_.samplesUsed) + "x") + ".");
bool predictive = uiPrefs_.predictiveStrokes;
- if (ImGui::Checkbox("Predictive Strokes", &predictive)) actions_.find("perf.predictive_strokes")->run();
+ if (ImGui::Checkbox(tr("Predictive Strokes"), &predictive)) actions_.find("perf.predictive_strokes")->run();
ui::HelpAction(*this, "perf.predictive_strokes");
bool draft = uiPrefs_.draftStrokes;
- if (ImGui::Checkbox("Draft Strokes", &draft)) actions_.find("perf.draft_strokes")->run();
+ if (ImGui::Checkbox(tr("Draft Strokes"), &draft)) actions_.find("perf.draft_strokes")->run();
ui::HelpAction(*this, "perf.draft_strokes");
// --- Threads ---
bool threads = !ThreadPool::shared().serial();
- if (ImGui::Checkbox("Multithreading##perf.mt", &threads)) actions_.find("perf.multithreading")->run();
+ if (ImGui::Checkbox(tr("Multithreading##perf.mt"), &threads)) actions_.find("perf.multithreading")->run();
ui::HelpAction(*this, "perf.multithreading");
ImGui::SameLine();
- ImGui::TextDisabled("%d threads", threads ? ThreadPool::shared().threads() : 1);
+ ImGui::TextDisabled(tr("%d threads"), threads ? ThreadPool::shared().threads() : 1);
// --- The last stroke ---
ImGui::Spacing();
- ImGui::TextUnformatted("Last stroke");
+ ImGui::TextUnformatted(tr("Last stroke"));
ui::HelpText("Last stroke", nullptr,
"What the last brush stroke cost, per dab (one step of the brush, all symmetry sides): finding and "
"moving the vertices, updating their normals and the BVH (the picking structure), and sending the "
@@ -202,7 +203,7 @@ void App::drawPerformanceSection() {
// --- Memory ---
ImGui::Spacing();
- ImGui::TextUnformatted("Memory");
+ ImGui::TextUnformatted(tr("Memory"));
ui::HelpText("Memory", nullptr,
"What the scene holds: the meshes with their topology, the BVHs, the subdivision levels kept for "
"stepping between them, the undo history (Edit keeps up to 1 GB, dropping the oldest steps), painted textures "
@@ -219,7 +220,7 @@ void App::drawPerformanceSection() {
ImGui::LogText("%s", mem.c_str());
if (perf_.gpuOutOfMemory) {
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(ui::color::danger));
- ImGui::TextWrapped("Not enough GPU memory to show every SubTool: hide some or step down a subdivision level.");
+ ImGui::TextWrapped("%s", tr("Not enough GPU memory to show every SubTool: hide some or step down a subdivision level."));
ImGui::PopStyleColor();
}
}
diff --git a/src/app/PanelPolygroups.cpp b/src/app/PanelPolygroups.cpp
index db923f7e..7e8e1217 100644
--- a/src/app/PanelPolygroups.cpp
+++ b/src/app/PanelPolygroups.cpp
@@ -9,6 +9,7 @@
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Polygroups.h"
@@ -56,7 +57,7 @@ void App::polygroupMouseUp() {
}
void App::drawPolygroupsSection() {
- ImGui::Checkbox("Show polygroups", &renderSettings_.showPolygroups);
+ ImGui::Checkbox(tr("Show polygroups"), &renderSettings_.showPolygroups);
ImGui::SameLine();
const Mesh& m = doc_.mesh;
const std::array<uint64_t, 6> key = {doc_.undo.revision() + 1, uint64_t(doc_.modified), m.triangles.size(),
@@ -66,8 +67,8 @@ void App::drawPolygroupsSection() {
visibleGroupsKey_ = key;
visibleGroups_ = visiblePolygroupCount(m);
}
- ImGui::TextDisabled("%zu", visibleGroups_);
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Visible polygroups");
+ ImGui::TextDisabled(tr("%zu"), visibleGroups_);
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Visible polygroups"));
// Grouping buttons switch the polygroup colours on so the result is visible.
auto group = [this](const char* command, const Args& args = {}) {
@@ -75,20 +76,20 @@ void App::drawPolygroupsSection() {
renderSettings_.showPolygroups = true;
};
const float half = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
- if (ImGui::Button("By normals", ImVec2(half, 0)))
+ if (ImGui::Button(tr("By normals"), ImVec2(half, 0)))
group("polygroup_auto_by_normals", {{"angle", double(polygroupAngle_)}});
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("New group wherever the surface turns more than the angle");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("New group wherever the surface turns more than the angle"));
ImGui::SameLine();
ImGui::SetNextItemWidth(-1);
ui::SliderInside("##pgangle", &polygroupAngle_, 1.0f, 90.0f, "Angle %.0f deg");
- if (ImGui::Button("By pieces", ImVec2(half, 0))) group("polygroup_by_connectivity");
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("One group per disconnected piece");
+ if (ImGui::Button(tr("By pieces"), ImVec2(half, 0))) group("polygroup_by_connectivity");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("One group per disconnected piece"));
ImGui::SameLine();
- if (ImGui::Button("From mask", ImVec2(half, 0))) group("polygroup_from_mask");
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Masked triangles become a new group");
- if (ImGui::Button("Merge visible", ImVec2(half, 0))) group("polygroup_merge_visible");
+ if (ImGui::Button(tr("From mask"), ImVec2(half, 0))) group("polygroup_from_mask");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Masked triangles become a new group"));
+ if (ImGui::Button(tr("Merge visible"), ImVec2(half, 0))) group("polygroup_merge_visible");
ImGui::SameLine();
- if (ImGui::Button("Clear groups", ImVec2(half, 0))) runCommand("polygroup_clear");
+ if (ImGui::Button(tr("Clear groups"), ImVec2(half, 0))) runCommand("polygroup_clear");
ui::ActionButton(*this, "polygroup.uv_groups", ImVec2(half, 0));
}
@@ -96,16 +97,16 @@ void App::drawVisibilitySection() {
ui::Segmented(*this, {"select.rect", "select.lasso"});
const float half = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
ImGui::BeginDisabled(!doc_.mesh.hasHidden());
- if (ImGui::Button("Show all", ImVec2(half, 0))) runCommand("show_all");
+ if (ImGui::Button(tr("Show all"), ImVec2(half, 0))) runCommand("show_all");
ImGui::EndDisabled();
ImGui::SameLine();
- if (ImGui::Button("Invert visible", ImVec2(half, 0))) runCommand("invert_visibility");
+ if (ImGui::Button(tr("Invert visible"), ImVec2(half, 0))) runCommand("invert_visibility");
ImGui::BeginDisabled(!doc_.mesh.hasHidden());
- if (ImGui::Button("Delete hidden", ImVec2(-1, 0))) runCommand("delete_hidden");
+ if (ImGui::Button(tr("Delete hidden"), ImVec2(-1, 0))) runCommand("delete_hidden");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
- ImGui::SetTooltip("Ctrl+Shift+click a group to isolate it, +Alt to hide it, on the background to show all.\n"
- "Ctrl+Shift+drag hides outside the rectangle or lasso (Alt: inside).");
+ ImGui::SetTooltip("%s", tr("Ctrl+Shift+click a group to isolate it, +Alt to hide it, on the background to show all.\n"
+ "Ctrl+Shift+drag hides outside the rectangle or lasso (Alt: inside)."));
}
} // namespace sf
diff --git a/src/app/PanelPolypaint.cpp b/src/app/PanelPolypaint.cpp
index 4a79844e..cfe94300 100644
--- a/src/app/PanelPolypaint.cpp
+++ b/src/app/PanelPolypaint.cpp
@@ -5,6 +5,7 @@
// picker and swatches, fills, and the viewport MatCap material picker.
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Matcap.h"
#include "core/Polypaint.h"
@@ -208,7 +209,7 @@ void App::setBackground(bool gradient, const glm::vec3& color) {
}
void App::drawBackgroundControls(const char* idSuffix) {
- ImGui::TextDisabled("Background");
+ ImGui::TextDisabled("%s", tr("Background"));
ui::Segmented(*this, {"view.background_gradient", "view.background_flat"});
// The picker edits the flat colour as shown (display values); picking one switches to Flat Colour.
glm::vec3 c = renderSettings_.backgroundColor;
@@ -304,14 +305,14 @@ void App::pickColorUnderCursor() {
// Color palette: the Paint brush (ZBrush Rgb / Zadd), the colour, swatches and fills.
void App::drawPalette_Color() {
- ImGui::SeparatorText("Paint");
+ ImGui::SeparatorText(tr("Paint"));
const bool painting = paintMode_;
if (painting) ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
- if (ImGui::Button("Paint brush (P)", ImVec2(-1, 0))) paintMode_ = !paintMode_;
+ if (ImGui::Button(tr("Paint brush (P)"), ImVec2(-1, 0))) paintMode_ = !paintMode_;
if (painting) ImGui::PopStyleColor();
ui::HelpAction(*this, "draw.paint");
- ImGui::Checkbox("RGB while sculpting", &paintRgb_);
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Sculpt brushes also paint the colour (ZBrush Rgb with Zadd)");
+ ImGui::Checkbox(tr("RGB while sculpting"), &paintRgb_);
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Sculpt brushes also paint the colour (ZBrush Rgb with Zadd)"));
// The picker edits display (sRGB) values; the mesh stores linear colour.
glm::vec3 srgb = linearToSrgb(doc_.paintColor);
@@ -342,7 +343,7 @@ void App::drawPalette_Color() {
if (hasTexture(m)) {
// Where paint goes, when the SubTool has a texture (Tool > Texture Map).
ImGui::AlignTextToFramePadding();
- ImGui::TextDisabled("Paint into");
+ ImGui::TextDisabled("%s", tr("Paint into"));
ImGui::SameLine();
ui::Segmented(*this, {"draw.paint_vertex", "draw.paint_texture"});
} else {
@@ -352,9 +353,9 @@ void App::drawPalette_Color() {
if (paintsTexture(m)) {
const PaintTexture& t = *m.texture;
const bool texLayered = t.activeLayer >= 0 && t.activeLayer < int(t.layers.size());
- ImGui::TextDisabled("Painting on: texture, %s", texLayered ? t.layers[size_t(t.activeLayer)].name.c_str() : "Base");
+ ImGui::TextDisabled(tr("Painting on: texture, %s"), texLayered ? t.layers[size_t(t.activeLayer)].name.c_str() : "Base");
} else
- ImGui::TextDisabled("Painting on: %s", layered ? m.paintLayers[size_t(m.activePaintLayer)].name.c_str() : "Base");
+ ImGui::TextDisabled(tr("Painting on: %s"), layered ? m.paintLayers[size_t(m.activePaintLayer)].name.c_str() : "Base");
ui::HelpText("Paint layer", nullptr,
"The paint layer the Paint brush and fills write into. Add and arrange layers in Tool > Paint Layers.",
"Color");
@@ -362,24 +363,24 @@ void App::drawPalette_Color() {
const float half = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
const std::string hex = colorToHex(doc_.paintColor);
- if (ImGui::Button("Fill", ImVec2(half, 0))) runCommand("paint_fill", {{"color", hex}});
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Fill the unmasked area (the whole mesh if nothing is masked)");
+ if (ImGui::Button(tr("Fill"), ImVec2(half, 0))) runCommand("paint_fill", {{"color", hex}});
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Fill the unmasked area (the whole mesh if nothing is masked)"));
ImGui::SameLine();
ImGui::BeginDisabled(!doc_.mesh.hasMask());
- if (ImGui::Button("Fill masked", ImVec2(half, 0)))
+ if (ImGui::Button(tr("Fill masked"), ImVec2(half, 0)))
runCommand("paint_fill", {{"color", hex}, {"area", std::string("masked")}});
ImGui::EndDisabled();
- if (ImGui::Button("Cavity", ImVec2(half, 0))) runCommand("paint_from_cavity");
- if (ImGui::IsItemHovered()) ImGui::SetTooltip("Darken creases and cavities (respects the mask)");
+ if (ImGui::Button(tr("Cavity"), ImVec2(half, 0))) runCommand("paint_from_cavity");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Darken creases and cavities (respects the mask)"));
ImGui::SameLine();
ImGui::BeginDisabled(!doc_.mesh.hasColors() && !paintsTexture(doc_.mesh));
- if (ImGui::Button("Clear", ImVec2(half, 0))) runCommand("paint_clear");
+ if (ImGui::Button(tr("Clear"), ImVec2(half, 0))) runCommand("paint_clear");
ImGui::EndDisabled();
ui::HelpText("Clear", nullptr, "Remove all polypaint from the SubTool, paint layers included (undoable).", "Color");
- ImGui::Checkbox("Show polypaint", &renderSettings_.showPolypaint);
+ ImGui::Checkbox(tr("Show polypaint"), &renderSettings_.showPolypaint);
if (hasTexture(doc_.mesh)) {
ImGui::SameLine();
- ImGui::Checkbox("Texture##show", &renderSettings_.showTexture);
+ ImGui::Checkbox(tr("Texture##show"), &renderSettings_.showTexture);
ui::HelpAction(*this, "view.texture");
}
}
@@ -388,21 +389,21 @@ void App::drawPalette_Color() {
// SubTool's own).
void App::drawPalette_Material() {
sf::drawMaterialGrid(*this, GridMode::Palette); // Pickers.cpp, as in the material picker (M)
- if (ImGui::Button("Load MatCap...", ImVec2(-1, 0))) loadMatcapDialog();
+ if (ImGui::Button(tr("Load MatCap..."), ImVec2(-1, 0))) loadMatcapDialog();
ui::HelpText("Load MatCap", nullptr,
"Use a MatCap image of your own: a lit sphere filling a square PNG, JPG or EXR. It joins the list "
"and is kept in Documents/SculptForge/MatCaps; images you put in that folder show up when a material list "
"opens. Right-click one of your MatCaps to remove it.",
"Material");
- ImGui::ColorEdit3("Base colour", &renderSettings_.baseColor.x, ImGuiColorEditFlags_NoInputs);
+ ImGui::ColorEdit3(tr("Base colour"), &renderSettings_.baseColor.x, ImGuiColorEditFlags_NoInputs);
ui::HelpText("Base colour", nullptr, "Colour of the Studio material (the clay colour).", "Material");
drawShadingControls();
}
void App::drawShadingControls() {
- ImGui::TextDisabled("Shading");
+ ImGui::TextDisabled("%s", tr("Shading"));
ui::Segmented(*this, {"material.smooth", "material.flat"});
- ImGui::TextDisabled("This SubTool");
+ ImGui::TextDisabled("%s", tr("This SubTool"));
ui::Segmented(*this, {"subtool.shading_default", "subtool.shading_smooth", "subtool.shading_flat"});
}
diff --git a/src/app/PanelProject.cpp b/src/app/PanelProject.cpp
index cb034079..f9cdc771 100644
--- a/src/app/PanelProject.cpp
+++ b/src/app/PanelProject.cpp
@@ -9,6 +9,7 @@
#include "app/CrashLog.h"
#include "core/SplatCapture.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "ai/Http.h"
@@ -438,7 +439,7 @@ void App::openPathConfirmed(const std::string& path) {
}
void App::drawFileMenuProjectItems() {
- if (ImGui::BeginMenu("Open Recent", !recentFiles_.empty())) {
+ if (ImGui::BeginMenu(tr("Open Recent"), !recentFiles_.empty())) {
const size_t before = recentFiles_.size();
recentFiles_ = pruneRecentFiles(std::move(recentFiles_), fileExists);
if (recentFiles_.size() != before) saveProjectPrefs();
@@ -449,17 +450,17 @@ void App::drawFileMenuProjectItems() {
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", recentFiles_[i].c_str());
}
ImGui::Separator();
- if (ImGui::MenuItem("Clear Recent")) {
+ if (ImGui::MenuItem(tr("Clear Recent"))) {
recentFiles_.clear();
saveProjectPrefs();
}
ImGui::EndMenu();
if (!chosen.empty()) openPathConfirmed(chosen);
}
- if (ImGui::MenuItem("Save", "Ctrl+S")) saveProjectAs(false);
- if (ImGui::MenuItem("Save As...", "Ctrl+Shift+S")) saveProjectAs(true);
+ if (ImGui::MenuItem(tr("Save"), "Ctrl+S")) saveProjectAs(false);
+ if (ImGui::MenuItem(tr("Save As..."), "Ctrl+Shift+S")) saveProjectAs(true);
ImGui::SetNextItemWidth(120.0f * uiScale_);
- ImGui::SliderInt("Autosave (min)", &autosaveMinutes_, 0, 60, autosaveMinutes_ ? "%d" : "off");
+ ImGui::SliderInt(tr("Autosave (min)"), &autosaveMinutes_, 0, 60, autosaveMinutes_ ? "%d" : "off");
if (ImGui::IsItemDeactivatedAfterEdit()) saveProjectPrefs();
}
@@ -472,11 +473,11 @@ void App::drawProjectPopups() {
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::BeginPopupModal(kUnsavedPopup, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
const std::string name = doc_.path.empty() ? std::string("Untitled") : utf8(fsPath(doc_.path).filename());
- ImGui::Text("Save changes to %s before continuing?", name.c_str());
- ImGui::TextDisabled("Your changes will be lost if you don't save them.");
+ ImGui::Text(tr("Save changes to %s before continuing?"), name.c_str());
+ ImGui::TextDisabled("%s", tr("Your changes will be lost if you don't save them."));
ImGui::Spacing();
const float w = 110.0f * uiScale_;
- if (ImGui::Button("Save", ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Enter)) {
+ if (ImGui::Button(tr("Save"), ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Enter)) {
ImGui::CloseCurrentPopup();
if (isProjectPath(doc_.path)) {
saveProjectTo(doc_.path);
@@ -489,14 +490,14 @@ void App::drawProjectPopups() {
}
}
ImGui::SameLine();
- if (ImGui::Button("Don't Save", ImVec2(w, 0))) {
+ if (ImGui::Button(tr("Don't Save"), ImVec2(w, 0))) {
ImGui::CloseCurrentPopup();
auto action = std::move(discardAction_);
discardAction_ = nullptr;
if (action) action();
}
ImGui::SameLine();
- if (ImGui::Button("Cancel", ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
+ if (ImGui::Button(tr("Cancel"), ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Escape)) {
ImGui::CloseCurrentPopup();
discardAction_ = nullptr;
}
@@ -514,17 +515,17 @@ void App::drawProjectPopups() {
drawUpdateBanner();
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::BeginPopupModal(kRestorePopup, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
- ImGui::TextUnformatted("SculptForge did not close normally last time.");
- ImGui::TextUnformatted("Restore the autosaved work?");
+ ImGui::TextUnformatted(tr("SculptForge did not close normally last time."));
+ ImGui::TextUnformatted(tr("Restore the autosaved work?"));
if (crashlog::previousCrashed()) {
ImGui::Spacing();
- ImGui::TextDisabled("What happened is in sculptforge-previous.log (Help > Open log folder);");
- ImGui::TextDisabled("please attach it if you report the problem.");
+ ImGui::TextDisabled("%s", tr("What happened is in sculptforge-previous.log (Help > Open log folder);"));
+ ImGui::TextDisabled("%s", tr("please attach it if you report the problem."));
}
ImGui::Spacing();
const float w = 110.0f * uiScale_;
const std::string autosave = autosavePath(prefDir_);
- if (ImGui::Button("Restore", ImVec2(w, 0))) {
+ if (ImGui::Button(tr("Restore"), ImVec2(w, 0))) {
ImGui::CloseCurrentPopup();
runCommand("open_project", {{"path", autosave}});
if (doc_.path == autosave) {
@@ -534,7 +535,7 @@ void App::drawProjectPopups() {
}
}
ImGui::SameLine();
- if (ImGui::Button("Discard", ImVec2(w, 0))) {
+ if (ImGui::Button(tr("Discard"), ImVec2(w, 0))) {
ImGui::CloseCurrentPopup();
std::error_code ec;
std::filesystem::remove(fsPath(autosave), ec);
@@ -609,25 +610,25 @@ void App::drawUpdateBanner() {
if (ImGui::Begin("##update_banner", nullptr, flags)) {
// Reading size (the guide's 17 px fonts), so the highlights are easy to read over the canvas.
if (ImFont* title = guide_.bodyBoldFont()) ImGui::PushFont(title);
- ImGui::Text("SculptForge %s is available", u.version.c_str());
+ ImGui::Text(tr("SculptForge %s is available"), u.version.c_str());
if (guide_.bodyBoldFont()) ImGui::PopFont();
if (ImFont* body = guide_.bodyFont()) ImGui::PushFont(body);
ImGui::SameLine();
- ImGui::TextDisabled("(you have %s)", SCULPTFORGE_VERSION);
+ ImGui::TextDisabled(tr("(you have %s)"), SCULPTFORGE_VERSION);
for (const auto& h : u.highlights) ImGui::BulletText("%s", h.c_str());
if (guide_.bodyFont()) ImGui::PopFont();
ImGui::Spacing();
bool close = false;
- if (ImGui::Button("What's new")) SDL_OpenURL(u.notesUrl.c_str());
+ if (ImGui::Button(tr("What's new"))) SDL_OpenURL(u.notesUrl.c_str());
ImGui::SameLine();
- if (ImGui::Button("Download")) {
+ if (ImGui::Button(tr("Download"))) {
SDL_OpenURL(u.downloadUrl.c_str());
close = true;
}
ImGui::SameLine();
- if (ImGui::Button("Later")) close = true;
+ if (ImGui::Button(tr("Later"))) close = true;
ImGui::SameLine();
- if (ImGui::Button("Skip this version")) {
+ if (ImGui::Button(tr("Skip this version"))) {
updateSkipped_ = u.version;
saveProjectPrefs();
close = true;
@@ -639,16 +640,16 @@ void App::drawUpdateBanner() {
void App::drawUpdatesSection() {
#if SF_UPDATE_CHECK
- if (ImGui::Checkbox("Check for updates", &checkUpdates_)) saveProjectPrefs();
+ if (ImGui::Checkbox(tr("Check for updates"), &checkUpdates_)) saveProjectPrefs();
ui::HelpText("Check for updates", nullptr,
"Once a day at startup, download a small file from the SculptForge website that names the newest "
"version, and show a banner when there is a newer one. Nothing about you or your computer is sent.",
"Preferences > Updates");
#else
- ImGui::TextWrapped("This build gets its updates from your package manager.");
+ ImGui::TextWrapped("%s", tr("This build gets its updates from your package manager."));
#endif
ui::ActionButton(*this, "help.check_updates", ImVec2(-1, 0));
- if (updateJob_) ImGui::TextDisabled("Checking...");
+ if (updateJob_) ImGui::TextDisabled("%s", tr("Checking..."));
else if (!updateStatus_.empty()) ImGui::TextWrapped("%s", updateStatus_.c_str());
}
diff --git a/src/app/PanelRetopo.cpp b/src/app/PanelRetopo.cpp
index 3a62dd90..b374571d 100644
--- a/src/app/PanelRetopo.cpp
+++ b/src/app/PanelRetopo.cpp
@@ -10,6 +10,7 @@
#include "app/Demo.h"
#include "app/Palettes.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/KeepMasked.h"
#include "core/TextureTransfer.h"
@@ -327,13 +328,13 @@ void App::drawQRemeshContents() {
ui::HelpText("QRemesh", nullptr, "Remeshing in the background. The result replaces the SubTool when it's done.",
kQRemeshPath);
ImGui::SameLine();
- if (ImGui::Button("Cancel", ImVec2(-1, 0))) qremesh_->cancel->store(true);
+ if (ImGui::Button(tr("Cancel"), ImVec2(-1, 0))) qremesh_->cancel->store(true);
ui::HelpText("Cancel", nullptr, "Stop QRemesh; the SubTool stays as it is.", kQRemeshPath);
} else {
ui::ActionButton(*this, "geometry.qremesh", ImVec2(half, 0));
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
- ImGui::TextDisabled("%zu polygons", faceCount(doc_.mesh));
+ ImGui::TextDisabled(tr("%zu polygons"), faceCount(doc_.mesh));
}
{
@@ -354,14 +355,14 @@ void App::drawQRemeshContents() {
kQRemeshPath);
const size_t faces = faceCount(doc_.mesh);
auto setTarget = [&](double k) { retopo_.target = int(std::clamp(double(faces) * k, 100.0, 2'000'000.0)); };
- if (ImGui::Button("Half", ImVec2(third, 0))) setTarget(0.5);
+ if (ImGui::Button(tr("Half"), ImVec2(third, 0))) setTarget(0.5);
ui::HelpText("Half", nullptr, "Target half the SubTool's current polygon count.", kQRemeshPath);
ImGui::SameLine();
- if (ImGui::Button("Same", ImVec2(third, 0))) setTarget(1.0);
+ if (ImGui::Button(tr("Same"), ImVec2(third, 0))) setTarget(1.0);
ui::HelpText("Same", nullptr, "Target the SubTool's current polygon count (to clean up topology without changing its density).",
kQRemeshPath);
ImGui::SameLine();
- if (ImGui::Button("Double", ImVec2(-1, 0))) setTarget(2.0);
+ if (ImGui::Button(tr("Double"), ImVec2(-1, 0))) setTarget(2.0);
ui::HelpText("Double", nullptr, "Target twice the SubTool's current polygon count.", kQRemeshPath);
ImGui::SetNextItemWidth(-1);
@@ -371,38 +372,38 @@ void App::drawQRemeshContents() {
"flat areas (the count stays near the target).",
kQRemeshPath);
- ImGui::Checkbox("Keep Groups", &retopo_.keepGroups);
+ ImGui::Checkbox(tr("Keep Groups"), &retopo_.keepGroups);
ui::HelpText("Keep Groups", nullptr,
"Edge loops follow the polygroup borders exactly and the result keeps the polygroups. Paint groups "
"where you want loops (around the eyes, the mouth) to guide the flow.",
kQRemeshPath);
ImGui::SameLine();
ImGui::SetCursorPosX(x0 + half + style.ItemSpacing.x); // the right column, inside the section indent
- ImGui::Checkbox("Detect Edges", &retopo_.detectEdges);
+ ImGui::Checkbox(tr("Detect Edges"), &retopo_.detectEdges);
ui::HelpText("Detect Edges", nullptr, "Hard edges get an edge loop, so they stay sharp (QRemesh 2: faces meeting at more than about 60 degrees along a line at least a few quads long; legacy: more than 50 degrees).",
kQRemeshPath);
- ImGui::Checkbox("Use Polypaint", &retopo_.usePolypaint);
+ ImGui::Checkbox(tr("Use Polypaint"), &retopo_.usePolypaint);
ui::HelpText("Use Polypaint", nullptr,
"Paint where you want density: red areas get up to 4 times the quads, blue areas down to a quarter, "
"white is unchanged.",
kQRemeshPath);
ImGui::SameLine();
ImGui::SetCursorPosX(x0 + half + style.ItemSpacing.x); // the right column, inside the section indent
- ImGui::Checkbox("Symmetry", &retopo_.symmetry);
+ ImGui::Checkbox(tr("Symmetry"), &retopo_.symmetry);
const char axis = char('X' + symmetryAxis(symmetry_));
const std::string symHelp = std::string("Mirror the topology across ") + axis +
" (the Transform palette's symmetry axis), welded on the seam. The mirror plane is the "
"model's own, so a model away from the world centre works too; a model that isn't "
"mirror-symmetric is remeshed without symmetry (the status line says so).";
ui::HelpText("Symmetry", nullptr, symHelp.c_str(), kQRemeshPath);
- ImGui::Checkbox("Keep Original", &retopo_.keepOriginal);
+ ImGui::Checkbox(tr("Keep Original"), &retopo_.keepOriginal);
ui::HelpText("Keep Original", nullptr,
"Keep the SubTool as it was, hidden, right below the new one (\"<name> Original\"), ready to "
"ProjectAll its detail back. Off: replace it, as ZBrush does (undo brings it back).",
kQRemeshPath);
ImGui::SameLine();
ImGui::SetCursorPosX(x0 + half + style.ItemSpacing.x); // the right column, inside the section indent
- ImGui::Checkbox("Keep Masked##qremesh", &retopo_.keepMasked);
+ ImGui::Checkbox(tr("Keep Masked##qremesh"), &retopo_.keepMasked);
ui::HelpText("Keep Masked", nullptr, kKeepMaskedHelp, kQRemeshPath);
if (hasTexture(doc_.mesh)) // only matters for a painted SubTool
drawKeepTextureCheckbox("Keep Texture##qremesh", kQRemeshPath);
@@ -416,15 +417,15 @@ void App::drawQRemeshReport() {
const QuadQuality& q = st.quality;
if (q.quads == 0) return;
tray::GroupLabel(*this, "Quality Report");
- ImGui::TextDisabled("%s: %zu quads in %.1f s", st.method == QRemeshMethod::Legacy ? "Legacy" : "QRemesh 2", q.quads,
+ ImGui::TextDisabled(tr("%s: %zu quads in %.1f s"), st.method == QRemeshMethod::Legacy ? "Legacy" : "QRemesh 2", q.quads,
st.seconds);
- ImGui::TextDisabled("Poles: %zu (3 edges %zu, 5 edges %zu, other %zu)", q.poles, q.valence[3], q.valence[5],
+ ImGui::TextDisabled(tr("Poles: %zu (3 edges %zu, 5 edges %zu, other %zu)"), q.poles, q.valence[3], q.valence[5],
q.poles - q.valence[3] - q.valence[5]);
- ImGui::TextDisabled("Corners off square: %.1f deg mean, %.0f deg worst 1%%", double(q.angleDeviation),
+ ImGui::TextDisabled(tr("Corners off square: %.1f deg mean, %.0f deg worst 1%%"), double(q.angleDeviation),
double(q.angleDeviationMax));
if (q.measured)
- ImGui::TextDisabled("Distance to the sculpt: %.3f%% mean, %.2f%% max", double(q.meanDistance), double(q.hausdorff));
- if (st.fallbackPieces) ImGui::TextDisabled("%zu piece(s) used the legacy method", st.fallbackPieces);
+ ImGui::TextDisabled(tr("Distance to the sculpt: %.3f%% mean, %.2f%% max"), double(q.meanDistance), double(q.hausdorff));
+ if (st.fallbackPieces) ImGui::TextDisabled(tr("%zu piece(s) used the legacy method"), st.fallbackPieces);
ui::HelpText("Quality Report", nullptr,
"How clean the new topology is: poles are vertices with other than four edges (fewer is cleaner), "
"corners off square measure how far quad corners are from 90 degrees, and the distance is how far the "
@@ -446,8 +447,8 @@ void App::drawQRemeshGuideControls() {
ImGui::AlignTextToFramePadding();
size_t loops = 0;
for (const QRemeshGuide& g : doc_.qremeshGuides) loops += g.closed;
- if (doc_.qremeshGuides.empty()) ImGui::TextDisabled("no curves");
- else ImGui::TextDisabled("%zu curves (%zu loops)", doc_.qremeshGuides.size(), loops);
+ if (doc_.qremeshGuides.empty()) ImGui::TextDisabled("%s", tr("no curves"));
+ else ImGui::TextDisabled(tr("%zu curves (%zu loops)"), doc_.qremeshGuides.size(), loops);
ui::ActionButton(*this, "geometry.qremesh_guides_delete_last", ImVec2(half, 0));
ImGui::SameLine();
ui::ActionButton(*this, "geometry.qremesh_guides_clear", ImVec2(-1, 0));
@@ -678,15 +679,15 @@ void App::drawProjectContents() {
ui::HelpText("PA Blur", nullptr, "Smooth the projected result this many times (softens noise from the source).",
kProjectPath);
ImGui::SameLine();
- ImGui::Checkbox("Mean", &retopo_.projectMean);
+ ImGui::Checkbox(tr("Mean"), &retopo_.projectMean);
ui::HelpText("Mean", nullptr,
"Where the source is found on both sides of a vertex, settle halfway between instead of on the nearest.",
kProjectPath);
- ImGui::Checkbox("Geometry", &retopo_.projectGeometry);
+ ImGui::Checkbox(tr("Geometry"), &retopo_.projectGeometry);
ui::HelpText("Geometry", nullptr, "Project the shape (into the active sculpt layer).", kProjectPath);
ImGui::SameLine();
ImGui::SetCursorPosX(x0 + half + style.ItemSpacing.x); // the right column, inside the section indent
- ImGui::Checkbox("Polypaint", &retopo_.projectPolypaint);
+ ImGui::Checkbox(tr("Polypaint"), &retopo_.projectPolypaint);
ui::HelpText("Polypaint", nullptr, "Project the polypaint (into the active paint layer) when a source has any.",
kProjectPath);
}
diff --git a/src/app/PanelSubTools.cpp b/src/app/PanelSubTools.cpp
index 02209162..c600a411 100644
--- a/src/app/PanelSubTools.cpp
+++ b/src/app/PanelSubTools.cpp
@@ -7,6 +7,7 @@
// through the subtool_* commands (core/SubTools.cpp).
#include "app/App.h"
#include "app/Theme.h"
+#include "app/I18n.h"
#include "core/Multires.h"
#include "render/GL.h"
@@ -265,19 +266,19 @@ void App::drawSubToolsContents() {
std::snprintf(renameBuffer_, sizeof renameBuffer_, "%s", s.name.c_str());
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal))
- ImGui::SetTooltip("%s\n%zu vertices, %zu triangles%s%s\nClick to select, double-click to rename",
+ ImGui::SetTooltip(tr("%s\n%zu vertices, %zu triangles%s%s\nClick to select, double-click to rename"),
s.name.c_str(), doc_.subtoolMesh(i).vertexCount(), doc_.subtoolMesh(i).triangleCount(),
subdivLevelCount(doc_.subtoolMesh(i)) ? ", " : "",
subdivLevelText(doc_.subtoolMesh(i)).c_str());
if (ImGui::BeginPopupContextItem("##row")) {
ImGui::TextDisabled("%s", s.name.c_str());
- if (ImGui::MenuItem("Rename")) {
+ if (ImGui::MenuItem(tr("Rename"))) {
renamingSubtool_ = s.id;
focusRename_ = true;
std::snprintf(renameBuffer_, sizeof renameBuffer_, "%s", s.name.c_str());
}
- if (ImGui::MenuItem("Duplicate")) duplicateIndex = i;
- if (ImGui::MenuItem("Delete...", nullptr, false, count > 1)) deleteIndex = i;
+ if (ImGui::MenuItem(tr("Duplicate"))) duplicateIndex = i;
+ if (ImGui::MenuItem(tr("Delete..."), nullptr, false, count > 1)) deleteIndex = i;
ImGui::EndPopup();
}
if (isActive && listedActiveSubtool_ != s.id) {
@@ -353,12 +354,12 @@ void App::drawSubToolsContents() {
"subtool_delete");
}
const float third = (ImGui::GetContentRegionAvail().x - 2 * style.ItemSpacing.x) / 3.0f;
- if (ImGui::Button("Append", ImVec2(third, 0))) ImGui::OpenPopup("##append");
- if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) ImGui::SetTooltip("Add a new SubTool beside the model");
+ if (ImGui::Button(tr("Append"), ImVec2(third, 0))) ImGui::OpenPopup("##append");
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) ImGui::SetTooltip("%s", tr("Add a new SubTool beside the model"));
if (ImGui::BeginPopup("##append")) {
- if (ImGui::MenuItem("Sphere")) runCommand("subtool_append", {{"type", std::string("sphere")}});
- if (ImGui::MenuItem("Cube")) runCommand("subtool_append", {{"type", std::string("cube")}});
- if (ImGui::MenuItem("Plane")) runCommand("subtool_append", {{"type", std::string("plane")}});
+ if (ImGui::MenuItem(tr("Sphere"))) runCommand("subtool_append", {{"type", std::string("sphere")}});
+ if (ImGui::MenuItem(tr("Cube"))) runCommand("subtool_append", {{"type", std::string("cube")}});
+ if (ImGui::MenuItem(tr("Plane"))) runCommand("subtool_append", {{"type", std::string("plane")}});
for (const char* t : {"cylinder", "cone", "torus", "capsule", "icosphere", "quadsphere"}) { // #31
std::string label = t;
label[0] = char(std::toupper(static_cast<unsigned char>(label[0])));
@@ -366,7 +367,7 @@ void App::drawSubToolsContents() {
if (ImGui::MenuItem(label.c_str())) runCommand("subtool_append", {{"type", std::string(t)}});
}
ImGui::Separator();
- if (ImGui::BeginMenu("Insert on the model")) { // #34: drag on the surface to place it
+ if (ImGui::BeginMenu(tr("Insert on the model"))) { // #34: drag on the surface to place it
for (const char* t : {"sphere", "cube", "cylinder", "cone", "torus", "capsule", "quadsphere"}) {
std::string label = t;
label[0] = char(std::toupper(static_cast<unsigned char>(label[0])));
@@ -378,7 +379,7 @@ void App::drawSubToolsContents() {
}
ImGui::Separator();
// Your own mesh (#34): a copy of another SubTool, or a model file you choose.
- if (ImGui::BeginMenu("Active SubTool's copy...", count > 1)) {
+ if (ImGui::BeginMenu(tr("Active SubTool's copy..."), count > 1)) {
for (int i = 0; i < count; ++i) {
if (i == active) continue;
const std::string& name = doc_.subtools[size_t(i)].name;
@@ -395,21 +396,21 @@ void App::drawSubToolsContents() {
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip(count > 1 ? "Insert a copy of another SubTool into the active one"
: "Append another SubTool first");
- if (ImGui::MenuItem("From file...##insert"))
+ if (ImGui::MenuItem(tr("From file...##insert")))
SDL_ShowOpenFileDialog(onAppendChosen, &dialogRequests_[int(FileAction::InsertMesh)], window_,
kInsertFilters, 2, nullptr, false);
ImGui::EndMenu();
}
- if (ImGui::MenuItem("From file..."))
+ if (ImGui::MenuItem(tr("From file...")))
SDL_ShowOpenFileDialog(onAppendChosen, &dialogRequests_[int(FileAction::AppendSubtool)], window_,
kAppendFilters, 2, nullptr, false);
ImGui::EndPopup();
}
ImGui::SameLine();
- if (ImGui::Button("Duplicate", ImVec2(third, 0))) runCommand("subtool_duplicate");
+ if (ImGui::Button(tr("Duplicate"), ImVec2(third, 0))) runCommand("subtool_duplicate");
ImGui::SameLine();
ImGui::BeginDisabled(count < 2);
- if (ImGui::Button("Delete...", ImVec2(third, 0)))
+ if (ImGui::Button(tr("Delete..."), ImVec2(third, 0)))
confirm("Delete SubTool?", "Delete \"" + activeName + "\"? This can't be undone.", "Delete", "subtool_delete");
ImGui::EndDisabled();
@@ -419,40 +420,40 @@ void App::drawSubToolsContents() {
if (ImGui::ArrowButton("##up", ImGuiDir_Up)) runCommand("subtool_move", {{"direction", std::string("up")}});
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
- ImGui::SetTooltip("Move up the list");
+ ImGui::SetTooltip("%s", tr("Move up the list"));
ImGui::SameLine();
ImGui::BeginDisabled(active >= count - 1);
if (ImGui::ArrowButton("##down", ImGuiDir_Down)) runCommand("subtool_move", {{"direction", std::string("down")}});
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
- ImGui::SetTooltip("Move down the list");
+ ImGui::SetTooltip("%s", tr("Move down the list"));
ImGui::SameLine();
const bool solo = count > 1 && visibleCount == 1 && doc_.activeSubtoolInfo().visible;
ImGui::BeginDisabled(count < 2);
if (solo) ImGui::PushStyleColor(ImGuiCol_Button, style.Colors[ImGuiCol_ButtonActive]);
- if (ImGui::Button("Solo", ImVec2(half2 - 2.0f * (arrowW + style.ItemSpacing.x), 0))) runCommand("subtool_solo");
+ if (ImGui::Button(tr("Solo"), ImVec2(half2 - 2.0f * (arrowW + style.ItemSpacing.x), 0))) runCommand("subtool_solo");
if (solo) ImGui::PopStyleColor();
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip(solo ? "Show the other SubTools again" : "Show only the active SubTool");
ImGui::SameLine();
ImGui::BeginDisabled(visibleCount == count);
- if (ImGui::Button("Unhide all", ImVec2(half2, 0))) runCommand("subtool_show_all");
+ if (ImGui::Button(tr("Unhide all"), ImVec2(half2, 0))) runCommand("subtool_show_all");
ImGui::EndDisabled();
const float half = (ImGui::GetContentRegionAvail().x - style.ItemSpacing.x) * 0.5f;
ImGui::BeginDisabled(active >= count - 1);
- if (ImGui::Button("Merge down...", ImVec2(half, 0)))
+ if (ImGui::Button(tr("Merge down..."), ImVec2(half, 0)))
confirm("Merge Down?",
"Merge \"" + doc_.subtools[size_t(std::min(active + 1, count - 1))].name + "\" into \"" + activeName +
"\"? This can't be undone,\nbut Split groups separates them again.",
"Merge", "subtool_merge_down");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
- ImGui::SetTooltip("Merge the active SubTool with the one below it");
+ ImGui::SetTooltip("%s", tr("Merge the active SubTool with the one below it"));
ImGui::SameLine();
ImGui::BeginDisabled(visibleCount < 2);
- if (ImGui::Button("Merge visible...", ImVec2(half, 0)))
+ if (ImGui::Button(tr("Merge visible..."), ImVec2(half, 0)))
confirm("Merge Visible?",
"Merge the " + std::to_string(visibleCount) + " visible SubTools into one? This can't be undone,\n"
"but Split groups separates them again.",
@@ -469,18 +470,18 @@ void App::drawSubToolsContents() {
std::any_of(g.begin(), g.end(), [&](uint32_t id) { return id != g.front(); });
}
ImGui::BeginDisabled(!splitGroupsPossible_);
- if (ImGui::Button("Split groups", ImVec2(half, 0))) runCommand("subtool_split_groups");
+ if (ImGui::Button(tr("Split groups"), ImVec2(half, 0))) runCommand("subtool_split_groups");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
- ImGui::SetTooltip("One SubTool per polygroup");
+ ImGui::SetTooltip("%s", tr("One SubTool per polygroup"));
ImGui::SameLine();
ImGui::BeginDisabled(doc_.mesh.triangleCount() == 0);
- if (ImGui::Button("Split parts", ImVec2(half, 0))) runCommand("subtool_split_parts");
+ if (ImGui::Button(tr("Split parts"), ImVec2(half, 0))) runCommand("subtool_split_parts");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
- ImGui::SetTooltip("One SubTool per disconnected piece");
+ ImGui::SetTooltip("%s", tr("One SubTool per disconnected piece"));
if (fontSmall_) ImGui::PushFont(fontSmall_);
- ImGui::TextDisabled("Alt+click a SubTool to select it");
+ ImGui::TextDisabled("%s", tr("Alt+click a SubTool to select it"));
if (fontSmall_) ImGui::PopFont();
}
@@ -500,7 +501,7 @@ void App::drawSubToolPopups() {
runCommand(subtoolConfirm_.command);
}
ImGui::SameLine();
- if (ImGui::Button("Cancel", ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Escape)) ImGui::CloseCurrentPopup();
+ if (ImGui::Button(tr("Cancel"), ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Escape)) ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
diff --git a/src/app/PanelTimeline.cpp b/src/app/PanelTimeline.cpp
index bbb6b0bc..142a22f5 100644
--- a/src/app/PanelTimeline.cpp
+++ b/src/app/PanelTimeline.cpp
@@ -10,6 +10,7 @@
#include "app/ShellQuote.h"
#include "app/Theme.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Json.h"
#include "core/Timeline.h"
@@ -326,7 +327,7 @@ void App::drawTimelineUi() {
if (ImGui::BeginPopupModal("Rendering timelapse", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text("%s", s.job->path.c_str());
ImGui::ProgressBar(float(s.job->frame) / float(std::max(1, s.job->frames)), ImVec2(360 * uiScale_, 0));
- if (ImGui::Button("Cancel")) s.job->cancelled = true;
+ if (ImGui::Button(tr("Cancel"))) s.job->cancelled = true;
ImGui::EndPopup();
}
activeUntil_ = std::max(activeUntil_, double(SDL_GetTicksNS()) * 1e-9 + 0.2);
@@ -345,21 +346,21 @@ void App::drawTimelineUi() {
s.timelapseDialog = false;
}
if (ImGui::BeginPopupModal("Export timelapse", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
- ImGui::TextWrapped("The history of the active SubTool (%zu steps up to the cursor) played as a turntable.", t->cursor());
+ ImGui::TextWrapped(tr("The history of the active SubTool (%zu steps up to the cursor) played as a turntable."), t->cursor());
ImGui::RadioButton("1080p", &s.timelapseRes, 0);
ImGui::SameLine();
ImGui::RadioButton("4K", &s.timelapseRes, 1);
ImGui::SetNextItemWidth(200 * uiScale_);
- ImGui::SliderFloat("Length", &s.timelapseSeconds, 5.0f, 90.0f, "%.0f s");
+ ImGui::SliderFloat(tr("Length"), &s.timelapseSeconds, 5.0f, 90.0f, "%.0f s");
ImGui::SetNextItemWidth(420 * uiScale_);
ImGui::InputText("File", s.timelapsePath, sizeof s.timelapsePath);
- if (ImGui::Button("Export")) {
+ if (ImGui::Button(tr("Export"))) {
const bool k4 = s.timelapseRes == 1;
startTimelapse(s.timelapsePath, k4 ? 3840 : 1920, k4 ? 2160 : 1080, s.timelapseSeconds, 30);
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
- if (ImGui::Button("Close")) ImGui::CloseCurrentPopup();
+ if (ImGui::Button(tr("Close"))) ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
@@ -407,7 +408,7 @@ void App::drawTimelineUi() {
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted(ICON_LC_HISTORY);
ImGui::SameLine();
- ImGui::Text("Step %zu of %zu", t->cursor(), n - 1);
+ ImGui::Text(tr("Step %zu of %zu"), t->cursor(), n - 1);
if (!branches.empty()) {
ImGui::SameLine();
ImGui::TextDisabled("%s %zu branch%s", ICON_LC_GIT_BRANCH, branches.size(), branches.size() == 1 ? "" : "es");
@@ -422,7 +423,7 @@ void App::drawTimelineUi() {
}
const float buttons = 250 * sc;
ImGui::SameLine(ImGui::GetWindowWidth() - buttons);
- if (ImGui::Checkbox("Save with project", &s.saveHistory)) {
+ if (ImGui::Checkbox(tr("Save with project"), &s.saveHistory)) {
Timeline::saveWithProject = s.saveHistory;
savePrefs(s, configDir_, uiConfigDeterministic_);
}
@@ -514,7 +515,7 @@ void App::drawTimelineUi() {
if (trackHovered && hovered != Timeline::kNone && !ImGui::IsPopupOpen("##retune")) {
const Timeline::Node& node = t->node(hovered);
const int d = t->depth(hovered);
- if (node.parent == Timeline::kNone) ImGui::SetTooltip("Start of the history");
+ if (node.parent == Timeline::kNone) ImGui::SetTooltip("%s", tr("Start of the history"));
else
ImGui::SetTooltip("Step %d: %s (%s)\n%u %s, %s%s\nClick or drag to show the model here; right-click to re-tune", d,
node.label.c_str(), kindLabel(node.kind), node.touched,
@@ -535,11 +536,11 @@ void App::drawTimelineUi() {
const uint32_t id = s.retuneNode;
if (id < t->nodeCount() && t->node(id).alive) {
const Timeline::Node& node = t->node(id);
- ImGui::Text("Step %d: %s", t->depth(id), node.label.c_str());
+ ImGui::Text(tr("Step %d: %s"), t->depth(id), node.label.c_str());
std::string why;
if (t->canRetune(id, &why)) {
ImGui::SetNextItemWidth(220 * sc);
- if (ImGui::SliderFloat("Strength", &s.retuneValue, 0.0f, 2.0f, "%.2f")) {
+ if (ImGui::SliderFloat(tr("Strength"), &s.retuneValue, 0.0f, 2.0f, "%.2f")) {
std::string e;
if (!t->retune(doc_, id, s.retuneValue, &e)) s.message = e;
doc_.modified = true;
@@ -548,7 +549,7 @@ void App::drawTimelineUi() {
"How strongly this stroke shows: 1 = as sculpted, 0 = gone, 2 = twice as strong. Later strokes "
"are not redone: where they overlap this one they keep their own displacement on top.",
"Edit > Sculpt Timeline");
- if (ImGui::SmallButton("Reset to 1")) {
+ if (ImGui::SmallButton(tr("Reset to 1"))) {
s.retuneValue = 1.0f;
t->retune(doc_, id, 1.0f);
}
@@ -556,12 +557,12 @@ void App::drawTimelineUi() {
} else {
ImGui::TextDisabled("%s", why.c_str());
}
- if (ImGui::SmallButton("Show the model here")) {
+ if (ImGui::SmallButton(tr("Show the model here"))) {
std::string e;
if (!t->select(doc_, id, &e)) s.message = e;
ImGui::CloseCurrentPopup();
}
- ImGui::TextDisabled("Sculpting from an earlier step starts a branch;\nthe later steps stay as a lane above.");
+ ImGui::TextDisabled("%s", tr("Sculpting from an earlier step starts a branch;\nthe later steps stay as a lane above."));
}
ImGui::EndPopup();
} else if (s.retuneNode != Timeline::kNone && !ImGui::IsPopupOpen("##retune")) {
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index 5f5760b2..59481238 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -11,6 +11,7 @@
#include "app/Shell.h"
#include "app/Theme.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include "core/Matcap.h"
#include "core/Polypaint.h"
#include "core/Texture.h"
@@ -225,7 +226,8 @@ int brushTypeOfAction(std::string_view id) {
bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
const bool on = a.checked && a.checked();
- const std::string id = a.label + "##" + a.id;
+ const std::string label = trAction(a.id, a.label); // the interface language (I18n.h)
+ const std::string id = label + "##" + a.id;
const float s = app.uiScale_;
const int type = brushTypeOfAction(a.id);
const int look = type >= 0 || a.id == "draw.paint" ? 3 : 2; // picture tile, or icon over caption
@@ -253,7 +255,7 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
const ImU32 fg = theme::u32(on ? (mode ? theme::textOnAccent : theme::textBright) : hovered || !a.checked ? theme::text : theme::textOff, alpha);
centredText(dl, app.fontIcons_, p0, ImVec2(p1.x, p1.y - capH + 2.0f * s), fg, a.icon ? a.icon : "?");
centredText(dl, caption, ImVec2(p0.x, p1.y - capH), ImVec2(p1.x, p1.y - 1.0f * s), fg,
- elide(caption ? caption : ImGui::GetFont(), a.label, size.x - 2.0f * s).c_str());
+ elide(caption ? caption : ImGui::GetFont(), label, size.x - 2.0f * s).c_str());
return clicked;
}
// Tile: a square picture (brush thumbnail or icon) with the name under it.
@@ -281,7 +283,7 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
if (key.size() == 1 && caption)
dl->AddText(caption, caption->FontSize, ImVec2(p0.x + 3 * s, p0.y + 1 * s), theme::u32(theme::textDim), key.c_str());
centredText(dl, caption, ImVec2(p0.x, p1.y - capH), p1, theme::u32(on ? theme::accent : theme::text, alpha),
- elide(caption ? caption : ImGui::GetFont(), a.label, size.x).c_str());
+ elide(caption ? caption : ImGui::GetFont(), label, size.x).c_str());
return clicked;
}
@@ -765,7 +767,7 @@ void App::drawTitleStrip(const ShellGeometry& g) {
// Document name; click saves.
ImGui::SameLine(0.0f, 16.0f * s);
- std::string name = doc_.path.empty() ? std::string("Untitled")
+ std::string name = doc_.path.empty() ? std::string(tr("Untitled"))
: std::filesystem::path(std::u8string(doc_.path.begin(), doc_.path.end())).filename().string();
if (doc_.dirty()) name += " *";
ImGui::SetCursorPosY((h - buttonH) * 0.5f);
@@ -781,7 +783,7 @@ void App::drawTitleStrip(const ShellGeometry& g) {
const bool quickSave = actions_.find("file.quicksave") != nullptr;
const float searchW = 150.0f * s;
const float windowButtonW = buttonH + 6.0f * s; // minimise and close, at the far right like ZBrush's
- float rightW = searchW + buttonW(ICON_LC_MENU " Menus") + 3.0f * (buttonH + 2.0f * s) + 18.0f * s +
+ float rightW = searchW + buttonW(tr(ICON_LC_MENU " Menus")) + 3.0f * (buttonH + 2.0f * s) + 18.0f * s +
10.0f * s + 2.0f * windowButtonW + 2.0f * s;
if (quickSave) rightW += buttonW("QuickSave") + 8.0f * s;
const float rightX = g.title.w - 8.0f * s - rightW;
@@ -797,13 +799,13 @@ void App::drawTitleStrip(const ShellGeometry& g) {
verts += doc_.subtoolMesh(i).vertexCount();
}
char info[256];
- std::snprintf(info, sizeof info, "Verts %s Tris %s SubTool %s (%d/%d) Layer %s%s%s",
+ std::snprintf(info, sizeof info, tr("Verts %s Tris %s SubTool %s (%d/%d) Layer %s%s%s"),
shortCount(verts).c_str(), shortCount(tris).c_str(), doc_.activeSubtoolInfo().name.c_str(),
doc_.activeSubtool + 1, doc_.subtoolCount(),
doc_.activeLayer >= 0 && doc_.activeLayer < int(doc_.mesh.layers.size())
? doc_.mesh.layers[size_t(doc_.activeLayer)].name.c_str()
- : "Base",
- doc_.splats.empty() ? "" : " Splats ", doc_.splats.empty() ? "" : shortCount(doc_.splats.size()).c_str());
+ : tr("Base"),
+ doc_.splats.empty() ? "" : tr(" Splats "), doc_.splats.empty() ? "" : shortCount(doc_.splats.size()).c_str());
// The frame rate gets a fixed-width slot, refreshed twice a second: a number that changes width every frame
// would make everything after it (the status message) jitter.
if (ImGui::GetTime() - fpsShownAt_ > 0.5 || fpsShown_ < 0.0f) {
@@ -823,7 +825,7 @@ void App::drawTitleStrip(const ShellGeometry& g) {
ImGui::TextDisabled("%s", fps);
ImGui::SameLine(0.0f, 0.0f);
ImGui::SetCursorPosX(slotX + fpsSlot);
- const std::string& msg = layout_.customize ? std::string("Customize: Ctrl+Alt+drag to move or remove items") : status_;
+ const std::string msg = layout_.customize ? std::string(tr("Customize: Ctrl+Alt+drag to move or remove items")) : tr(status_);
if (!msg.empty() && avail - infoW > 60.0f * s) {
// The status message is what just happened, so it stands out from the readout: the regular font, in
// the bright text colour (still elided to the space the small-font readout leaves).
@@ -868,7 +870,7 @@ void App::drawTitleStrip(const ShellGeometry& g) {
const bool hovered = ImGui::IsItemHovered();
dl->AddRectFilled(p, ImVec2(p.x + searchW, p.y + buttonH), theme::u32(hovered ? theme::frameHover : theme::frame), 3.0f * s);
const float ty = p.y + (buttonH - ImGui::GetFontSize()) * 0.5f;
- dl->AddText(ImVec2(p.x + 7.0f * s, ty), theme::u32(theme::textDim), ICON_LC_SEARCH " Search");
+ dl->AddText(ImVec2(p.x + 7.0f * s, ty), theme::u32(theme::textDim), tr(ICON_LC_SEARCH " Search"));
const ImVec2 kw = ImGui::CalcTextSize("F3");
dl->AddText(ImVec2(p.x + searchW - kw.x - 7.0f * s, ty), theme::u32(theme::textDim, 0.8f), "F3");
if (clicked) {
@@ -943,7 +945,7 @@ void App::drawPaletteBar(const ShellGeometry& g) {
ImGui::PushStyleColor(ImGuiCol_Text, inTray ? theme::accent : open ? theme::textOnAccent : theme::text);
const bool gap = !uiPrefs_.alphabeticalPalettes && (k == 2 || (help >= 0 && k + 1 == order.size()));
if (i) ImGui::SameLine(0.0f, gap ? 10.0f * s : -1.0f); // small gaps after File, Edit and before Help
- const std::string label = std::string(p.name) + "##palette." + p.id;
+ const std::string label = std::string(tr(p.name)) + "##palette." + p.id;
// While a drop-down is open, the click that closes it (ImGui swallows that one) opens another palette
// when it lands on that palette's name, as in a menu bar; on the open palette's own name it just closes.
const bool pressed = ImGui::Button(label.c_str(), ImVec2(0, g.paletteBar.h - 1.0f));
@@ -984,13 +986,13 @@ bool App::paletteHeader(const char* id, bool inTray, bool right) {
const bool iconHovered = ImGui::IsItemHovered();
if (!inTray && ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceNoDisableHover)) {
ImGui::SetDragDropPayload("SF_PALETTE", id, std::strlen(id) + 1);
- ImGui::Text(ICON_LC_PANEL_RIGHT " %s", def->name);
+ ImGui::Text(ICON_LC_PANEL_RIGHT " %s", tr(def->name));
ImGui::EndDragDropSource();
}
- if (inTray) ui::HelpText("Back to the palette bar", nullptr, "Take this palette out of the tray.", def->name);
+ if (inTray) ui::HelpText("Back to the palette bar", nullptr, "Take this palette out of the tray.", tr(def->name));
else
ui::HelpText("Move to the tray", nullptr,
- "Keep this palette in the right tray (Shift+click: left tray), or drag the icon onto a tray.", def->name);
+ "Keep this palette in the right tray (Shift+click: left tray), or drag the icon onto a tray.", tr(def->name));
centredText(dl, nullptr, p, ImVec2(p.x + h, p.y + h), theme::u32(iconHovered ? theme::accentHover : theme::textDim),
inTray ? (right ? ICON_LC_PANEL_RIGHT : ICON_LC_PANEL_LEFT) : ICON_LC_PANEL_RIGHT);
ImGui::SameLine();
@@ -998,8 +1000,8 @@ bool App::paletteHeader(const char* id, bool inTray, bool right) {
const bool titleHovered = ImGui::IsItemHovered();
if (fontBold_) ImGui::PushFont(fontBold_);
dl->AddText(ImVec2(p.x + h + 2.0f * s, p.y + (h - ImGui::GetFontSize()) * 0.5f),
- theme::u32(titleHovered && inTray ? theme::textOnAccent : theme::text), def->name);
- ImGui::LogText("%s", def->name);
+ theme::u32(titleHovered && inTray ? theme::textOnAccent : theme::text), tr(def->name));
+ ImGui::LogText("%s", tr(def->name));
if (fontBold_) ImGui::PopFont();
ImGui::SameLine();
const bool endClicked = ImGui::InvisibleButton(inTray ? "##collapse" : "##close", ImVec2(h, h));
@@ -1474,7 +1476,7 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vert
ImGui::Dummy(ImVec2(0, 0)); // an id this version doesn't know: keep its place in the list
}
if (item != "sep" && ImGui::BeginPopupContextItem("##shelfitem")) {
- if (ImGui::MenuItem("Remove from shelf")) {
+ if (ImGui::MenuItem(tr("Remove from shelf"))) {
auto& list = shelf == kShelfTop ? layout_.topShelf
: shelf == kShelfLeft ? layout_.leftShelf
: shelf == kShelfRight ? layout_.rightShelf
@@ -1482,10 +1484,10 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vert
if (index < int(list.size()) && list[size_t(index)] == item) list.erase(list.begin() + index);
noteLayoutChanged();
}
- if (shelf == kShelfBottom && ImGui::BeginMenu("Tile size")) { // also in Preferences > Interface
+ if (shelf == kShelfBottom && ImGui::BeginMenu(tr("Tile size"))) { // also in Preferences > Interface
static const char* kTiles[] = {"Small", "Medium", "Large"};
for (int i = 0; i < 3; ++i)
- if (ImGui::MenuItem(kTiles[i], nullptr, layout_.shelfTiles == i)) layout_.shelfTiles = i;
+ if (ImGui::MenuItem(tr(kTiles[i]), nullptr, layout_.shelfTiles == i)) layout_.shelfTiles = i;
ImGui::EndMenu();
}
ImGui::EndPopup();
@@ -1549,7 +1551,8 @@ void App::finishShelfDrag() {
}
// Right-shelf Move / Zoom / Rotate: drag on the button to navigate, as in ZBrush.
-bool App::canvasNavButton(const char* id, const char* icon, const char* label, int mode) {
+bool App::canvasNavButton(const char* id, const char* icon, const char* englishLabel, int mode) {
+ const char* label = tr(englishLabel);
const float s = uiScale_;
const ImVec2 size(44.0f * s, 40.0f * s);
ImGui::InvisibleButton((std::string(label) + "##" + id).c_str(), size);
diff --git a/src/app/SpaceMouse.cpp b/src/app/SpaceMouse.cpp
index d850959f..d5e81cef 100644
--- a/src/app/SpaceMouse.cpp
+++ b/src/app/SpaceMouse.cpp
@@ -11,6 +11,7 @@
// Config keeps them. User guide: docs/guide/navigation.md.
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include <IconsLucide.h>
@@ -171,7 +172,7 @@ void App::drawSpaceMouseSection() {
const char* path = "Preferences > Input > SpaceMouse";
const float width = ImGui::GetContentRegionAvail().x;
ImGui::Spacing();
- ImGui::SeparatorText("SpaceMouse (experimental)");
+ ImGui::SeparatorText(tr("SpaceMouse (experimental)"));
if (spaceMouse_) {
ImGui::TextColored(col(ui::color::accent), ICON_LC_JOYSTICK);
ImGui::SameLine();
@@ -181,11 +182,11 @@ void App::drawSpaceMouseSection() {
ImGui::PushStyleColor(ImGuiCol_Text, col(ui::color::textDim));
ImGui::PushTextWrapPos(0.0f);
#if defined(_WIN32) || defined(__APPLE__)
- ImGui::TextUnformatted("Plug it in. If 3DxWare is installed it may keep the device to itself: see the "
- "Navigation page of the guide.");
+ ImGui::TextUnformatted(tr("Plug it in. If 3DxWare is installed it may keep the device to itself: see the "
+ "Navigation page of the guide."));
#else
- ImGui::TextUnformatted("Plug it in. SculptForge reads it as a joystick (/dev/input): you need read access to "
- "it, and spacenavd may hold it. See the Navigation page of the guide.");
+ ImGui::TextUnformatted(tr("Plug it in. SculptForge reads it as a joystick (/dev/input): you need read access to "
+ "it, and spacenavd may hold it. See the Navigation page of the guide."));
#endif
ImGui::PopTextWrapPos();
ImGui::PopStyleColor();
@@ -219,7 +220,7 @@ void App::drawSpaceMouseSection() {
"Only the direction you push the most moves the view: a twist doesn't also pan a little.", path);
// Invert, two rows of three: the moves, then the turns.
- ImGui::TextDisabled("Invert");
+ ImGui::TextDisabled("%s", tr("Invert"));
const float cw = (width - 2.0f * ImGui::GetStyle().ItemSpacing.x) / 3.0f;
for (int i = 0; i < kSmAxes; ++i) {
if (i % 3) ImGui::SameLine(float(i % 3) * (cw + ImGui::GetStyle().ItemSpacing.x));
@@ -234,7 +235,7 @@ void App::drawSpaceMouseSection() {
// order above, filled from the centre; grey while inside the dead zone.
if (spaceMouse_) {
ImGui::AlignTextToFramePadding();
- ImGui::TextDisabled("Live");
+ ImGui::TextDisabled("%s", tr("Live"));
ImGui::SameLine();
const float x0 = ImGui::GetCursorScreenPos().x, avail = ImGui::GetContentRegionAvail().x;
const float gap = 4.0f * ImGui::GetFontSize() / 15.0f, bw = (avail - 5.0f * gap) / 6.0f;
diff --git a/src/app/Tablet.cpp b/src/app/Tablet.cpp
index bc9aedf8..41d326e2 100644
--- a/src/app/Tablet.cpp
+++ b/src/app/Tablet.cpp
@@ -10,6 +10,7 @@
// the math is in core/Tablet.h. User guide: docs/tablet.md.
#include "app/App.h"
#include "app/Ui.h"
+#include "app/I18n.h"
#include <IconsLucide.h>
@@ -261,10 +262,10 @@ void App::drawTabletSection() {
ImGui::PushStyleColor(ImGuiCol_Text, col(ui::color::textDim));
ImGui::PushTextWrapPos(0.0f);
#if defined(_WIN32)
- ImGui::TextUnformatted("Bring the pen close to the tablet. Wacom: turn on \"Use Windows Ink\" in Wacom Tablet "
- "Properties > Mapping; Huion / XP-Pen: enable Windows Ink in the driver.");
+ ImGui::TextUnformatted(tr("Bring the pen close to the tablet. Wacom: turn on \"Use Windows Ink\" in Wacom Tablet "
+ "Properties > Mapping; Huion / XP-Pen: enable Windows Ink in the driver."));
#else
- ImGui::TextUnformatted("Bring the pen close to the tablet. Pressure works through the system's tablet driver.");
+ ImGui::TextUnformatted(tr("Bring the pen close to the tablet. Pressure works through the system's tablet driver."));
#endif
ImGui::PopTextWrapPos();
ImGui::PopStyleColor();
@@ -285,7 +286,7 @@ void App::drawTabletSection() {
}
// --- Pen or mouse mode (#54) ---
- ImGui::Checkbox("Mouse mode (relative)##tablet_mouse_mode", &t.mouseMode);
+ ImGui::Checkbox(tr("Mouse mode (relative)##tablet_mouse_mode"), &t.mouseMode);
ui::HelpText("Mouse mode", nullptr,
"Turn on if the tablet driver is set to Mouse mode: the pen moves the cursor by how far it moves, and "
"lifting it and putting it down elsewhere leaves the cursor where it was. Off (Pen mode): the cursor "
@@ -302,7 +303,7 @@ void App::drawTabletSection() {
ui::HelpText("Pressure meter", nullptr,
"The pen's pressure as the tablet reports it, and after the pressure curve below (what brushes get).", path);
if (penTiltSeen_) {
- ImGui::Text("Tilt X %+.0f" "\xc2\xb0" " Y %+.0f" "\xc2\xb0", penTiltX_, penTiltY_);
+ ImGui::Text(tr("Tilt X %+.0f" "\xc2\xb0" " Y %+.0f" "\xc2\xb0"), penTiltX_, penTiltY_);
ui::HelpText("Tilt", nullptr, "The pen's tilt, as the tablet reports it (brushes don't use it yet).", path);
} else if (penSeen_) {
ImGui::TextColored(col(ui::color::textDim), "Tilt: not reported by this pen");
@@ -468,7 +469,7 @@ void App::drawTabletSection() {
"button: Pan view. The curve and Mouse mode stay.", path);
ImGui::PushStyleColor(ImGuiCol_Text, col(ui::color::textDim));
ImGui::PushTextWrapPos(0.0f);
- ImGui::TextUnformatted("Store Config (Ctrl+Shift+I) keeps these settings.");
+ ImGui::TextUnformatted(tr("Store Config (Ctrl+Shift+I) keeps these settings."));
ImGui::PopTextWrapPos();
ImGui::PopStyleColor();
}
diff --git a/src/app/Ui.cpp b/src/app/Ui.cpp
index 31bf5e6a..1f674c17 100644
--- a/src/app/Ui.cpp
+++ b/src/app/Ui.cpp
@@ -3,6 +3,7 @@
#include "app/Ui.h"
#include "app/App.h"
+#include "app/I18n.h"
#include "app/Shell.h"
#include "app/Theme.h"
@@ -101,9 +102,9 @@ void HelpText(const char* title, const char* shortcut, const char* description,
if (!wantHelp() || !itemHoveredForHelp()) return;
g_help = HelpRequest{};
g_help.active = true;
- g_help.title = title ? title : "";
+ g_help.title = title ? tr(title) : "";
g_help.shortcut = shortcut ? shortcut : "";
- g_help.description = description ? description : "";
+ g_help.description = description ? tr(description) : "";
g_help.path = path ? path : "";
g_help.disabled = (ImGui::GetItemFlags() & ImGuiItemFlags_Disabled) != 0;
}
@@ -122,7 +123,7 @@ bool IsChoiceAction(std::string_view id) {
}
bool Checkbox(const char* label, bool* v) {
- const bool changed = ImGui::Checkbox(label, v);
+ const bool changed = ImGui::Checkbox(tr(label), v);
if (!*v) {
const ImVec2 a = ImGui::GetItemRectMin();
const float sz = ImGui::GetFrameHeight();
@@ -159,16 +160,16 @@ void HelpAction(App& app, const char* actionId) {
if (!a) return;
g_help = HelpRequest{};
g_help.active = true;
- g_help.title = a->label;
+ g_help.title = trAction(a->id, a->label);
g_help.actionId = a->id;
g_help.icon = a->icon;
g_help.shortcut = app.actions().shortcutText(a->id);
g_help.path = a->palette;
g_help.command = a->command;
g_help.disabled = a->enabled && !a->enabled();
- g_help.description = a->description;
+ g_help.description = tr(a->description);
if (const Command* c = a->command.empty() ? nullptr : app.commands().find(a->command)) {
- if (g_help.description.empty()) g_help.description = c->description;
+ if (g_help.description.empty()) g_help.description = tr(c->description);
g_help.params = c->params;
g_help.hasCommand = true;
}
@@ -236,7 +237,7 @@ void Keycaps(const std::string& chord) {
void DelayedTooltip(const char* text) {
if (!text || !*text || CtrlHeld()) return;
- if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay)) ImGui::SetTooltip("%s", text);
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay)) ImGui::SetTooltip("%s", tr(text));
}
bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
@@ -250,7 +251,7 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
return false;
}
// Copy what we need: running the action may add or replace actions.
- const std::string id = a->id, label = a->label;
+ const std::string id = a->id, label = trAction(a->id, a->label); // the visible words in the interface language (I18n.h)
const char* icon = a->icon;
const std::function<void()> run = a->run;
const bool enabled = !a->enabled || a->enabled();
@@ -364,7 +365,7 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* form
// No grab over the label: the position shows as the fill and a thin accent bar along the bottom (ZBrush).
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0, 0, 0, 0));
- const bool changed = ImGui::SliderFloat(id, v, lo, hi, format, flags);
+ const bool changed = ImGui::SliderFloat(id, v, lo, hi, format ? tr(format) : format, flags);
const bool active = ImGui::IsItemActive();
ImGui::PopStyleColor(5);
dl->ChannelsSetCurrent(0);
@@ -451,7 +452,7 @@ void DrawHelp(App& app) {
ImGui::PushTextWrapPos(0.0f);
if (!alternate) {
ImGui::PushStyleColor(ImGuiCol_Text, rgba(IM_COL32(0xc8, 0xc8, 0xc8, 0xff)));
- ImGui::TextUnformatted(r.description.empty() ? "No description yet." : r.description.c_str());
+ ImGui::TextUnformatted(r.description.empty() ? tr("No description yet.") : r.description.c_str());
ImGui::PopStyleColor();
if (r.hasCommand && !r.params.empty()) {
ImGui::PushStyleColor(ImGuiCol_Text, rgba(color::textDim));
@@ -479,7 +480,7 @@ void DrawHelp(App& app) {
ImGui::Unindent(10.0f * s);
}
}
- if (r.disabled) ImGui::TextColored(rgba(color::danger), "Not available right now.");
+ if (r.disabled) ImGui::TextColored(rgba(color::danger), "%s", tr("Not available right now."));
ImGui::PopTextWrapPos();
// The user guide chapter about it: F1 (with Ctrl still held) opens it.
if (const std::string chapter = UserGuide::chapterFor(r.path, r.actionId); !chapter.empty()) {
@@ -488,7 +489,7 @@ void DrawHelp(App& app) {
ImGui::Dummy(ImVec2(0, 1.0f * s));
Keycaps("F1");
ImGui::SameLine();
- ImGui::TextColored(rgba(color::textDim), "Learn more: %s", title.c_str());
+ ImGui::TextColored(rgba(color::textDim), tr("Learn more: %s"), title.c_str());
if (ImGui::IsKeyPressed(ImGuiKey_F1, false)) app.guide().open(chapter);
r.description += "\nLearn more: " + title;
}
@@ -497,7 +498,7 @@ void DrawHelp(App& app) {
if (!r.path.empty() || !r.command.empty()) {
ImGui::Dummy(ImVec2(0, 2.0f * s));
ImGui::SetWindowFontScale(0.82f);
- if (!r.path.empty()) ImGui::TextColored(rgba(color::textDim), "%s", r.path.c_str());
+ if (!r.path.empty()) ImGui::TextColored(rgba(color::textDim), "%s", trPath(r.path).c_str());
ImGui::SetWindowFontScale(1.0f);
if (!r.command.empty()) {
ImGui::PushFont(app.consoleFont());
diff --git a/tests/test_i18n.cpp b/tests/test_i18n.cpp
new file mode 100644
index 00000000..20614049
--- /dev/null
+++ b/tests/test_i18n.cpp
@@ -0,0 +1,159 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// The interface language (#44, app/I18n.h): exact lookups, the English fallback, labels whose "##id" must not
+// change, icon prefixes and printf tails, and a Spanish table that is safe to hand to printf.
+#include "TestHarness.h"
+
+#include "app/I18n.h"
+
+#include <cstdio>
+#include <set>
+#include <string>
+#include <string_view>
+#include <vector>
+
+using namespace sf;
+
+namespace {
+
+// Restores the language when a test ends, so the other tests run in English.
+struct LanguageScope {
+ Language saved = language();
+ explicit LanguageScope(Language lang) { setLanguage(lang); }
+ ~LanguageScope() { setLanguage(saved); }
+};
+
+// The printf conversions of a format string, in order ("%d", "%.1f", "%%" ...).
+std::vector<std::string> conversions(std::string_view s) {
+ std::vector<std::string> out;
+ for (size_t i = 0; i < s.size(); ++i) {
+ if (s[i] != '%') continue;
+ size_t j = i + 1;
+ while (j < s.size() && std::string_view("-+ #0123456789.*hlzjt").find(s[j]) != std::string_view::npos) ++j;
+ if (j < s.size()) out.emplace_back(s.substr(i, j - i + 1));
+ i = j;
+ }
+ return out;
+}
+
+} // namespace
+
+TEST(i18n_english_returns_the_argument) {
+ LanguageScope scope(Language::English);
+ const char* text = "Decimate##remesh";
+ CHECK(tr(text) == text); // the very same pointer: no copy, no lookup
+ CHECK(tr(std::string("Undo")) == "Undo");
+ CHECK(trPath("Tool > Geometry") == "Tool > Geometry");
+ CHECK(tr(static_cast<const char*>(nullptr)) == nullptr);
+}
+
+TEST(i18n_spanish_lookup_and_fallback) {
+ LanguageScope scope(Language::Spanish);
+ CHECK(std::string(tr("Preferences")) == "Preferencias");
+ CHECK(std::string(tr("Undo")) == "Deshacer");
+ CHECK(std::string(tr("Masking")) == "Enmascarado");
+ // No entry: the English text, unchanged (and the same pointer).
+ const char* missing = "Frobnicate the widget";
+ CHECK(tr(missing) == missing);
+ CHECK(std::string(tr("Unknown##some.id")) == "Unknown##some.id");
+ CHECK(std::string(tr("")) == "");
+ // Brand and tool names stay as they are.
+ CHECK(std::string(tr("SubTool")) == "SubTool");
+ CHECK(std::string(tr("QRemesh")) == "QRemesh");
+ CHECK(std::string(tr("LightBox")) == "LightBox");
+ // Brush names are never translated, even where the word has an entry ("Move" the tool is "Mover").
+ const std::string move = "Move";
+ CHECK(std::string(trAction("brush.move", move)) == "Move");
+ CHECK(std::string(trAction("tool.move", move)) == "Mover");
+ CHECK(trPath("Tool > Geometry") == "Herramienta > Geometría");
+ CHECK(trPath("Tool > Frobnicate") == "Herramienta > Frobnicate");
+}
+
+TEST(i18n_keeps_ids_icons_and_tails) {
+ LanguageScope scope(Language::Spanish);
+ // Everything from "##" on is kept exactly, so the ImGui id of the item stays the same.
+ CHECK(std::string(tr("Decimate##decimate")) == "Diezmar##decimate");
+ CHECK(std::string(tr("Keep Masked##remesh")) == "Conservar máscara##remesh");
+ CHECK(std::string(tr("Show Polygroups##render")) == "Mostrar poligrupos##render");
+ CHECK(std::string(tr("Display###window.display")) == "Visualización###window.display");
+ CHECK(std::string(tr("##only.an.id")) == "##only.an.id");
+ // An icon in front is kept, the words after it translated.
+ CHECK(std::string(tr("\xee\x80\xb8 Filter")) == "\xee\x80\xb8 Filtrar");
+ // "..." and ":" endings, and printf tails, when there is no exact entry.
+ CHECK(std::string(tr("Save As...")) == "Guardar como...");
+ CHECK(std::string(tr("Open...##file.open")) == "Abrir...##file.open");
+ CHECK(std::string(tr("Shelf tiles:")) == "Fichas del estante:");
+ CHECK(std::string(tr("Draw Size %.0f")) == "Tamaño de dibujo %.0f");
+ CHECK(std::string(tr("Resolution %.0f")) == "Resolución %.0f");
+ // An exact entry wins over the pieces.
+ CHECK(std::string(tr("Every %d min")) == "Cada %d min");
+ // The pointer stays valid and the same on later calls (labels are asked for every frame).
+ const char* first = tr("Decimate##decimate");
+ CHECK(first == tr("Decimate##decimate"));
+ // Back in English the original text comes back.
+ setLanguage(Language::English);
+ CHECK(std::string(tr("Decimate##decimate")) == "Decimate##decimate");
+}
+
+TEST(i18n_language_codes) {
+ CHECK(std::string(languageCode(Language::English)) == "en");
+ CHECK(std::string(languageCode(Language::Spanish)) == "es");
+ CHECK(languageFromCode("es") == Language::Spanish);
+ CHECK(languageFromCode("es-MX") == Language::Spanish);
+ CHECK(languageFromCode("en") == Language::English);
+ CHECK(languageFromCode("klingon") == Language::English);
+ CHECK(languageFromCode("") == Language::English);
+ CHECK(std::string(languageName(Language::Spanish)) == "Espa\xc3\xb1ol");
+}
+
+TEST(i18n_spanish_table_is_well_formed) {
+ std::set<std::string_view> seen;
+ int problems = 0;
+ for (const i18n::Entry& e : i18n::spanishTable()) {
+ const std::string_view en = e.english, es = e.translated;
+ // One entry per English text, both sides non-empty, no ImGui ids in the table (tr() keeps those).
+ if (!seen.insert(en).second || en.empty() || es.empty() || en.find("##") != std::string_view::npos ||
+ es.find("##") != std::string_view::npos) {
+ std::printf(" bad entry: \"%.*s\"\n", int(en.size()), en.data());
+ ++problems;
+ }
+ // Formats are handed to printf: the translation has the same conversions, in the same order.
+ if (conversions(en) != conversions(es)) {
+ std::printf(" printf conversions differ: \"%.*s\"\n", int(en.size()), en.data());
+ ++problems;
+ }
+ // Leading and trailing spaces line up with the English (they are layout).
+ if ((en.front() == ' ') != (es.front() == ' ') || (en.back() == ' ') != (es.back() == ' ')) {
+ std::printf(" spacing differs: \"%.*s\"\n", int(en.size()), en.data());
+ ++problems;
+ }
+ }
+ CHECK(problems == 0);
+ CHECK(seen.size() > 300);
+}
+
+TEST(i18n_spanish_table_fits_the_font) {
+ // The UI font is Inter rasterised with ImGui's default ranges, Basic Latin + Latin-1 (U+0020-U+00FF), plus the
+ // Lucide icons (U+E000-U+F8FF): every character of the table has to be in those, or it draws as "?".
+ int outside = 0;
+ for (const i18n::Entry& e : i18n::spanishTable()) {
+ const std::string_view s = e.translated;
+ for (size_t i = 0; i < s.size();) {
+ const unsigned char c = static_cast<unsigned char>(s[i]);
+ unsigned cp = c;
+ size_t n = 1;
+ if (c >= 0xF0) n = 4, cp = c & 0x07;
+ else if (c >= 0xE0) n = 3, cp = c & 0x0F;
+ else if (c >= 0xC0) n = 2, cp = c & 0x1F;
+ for (size_t k = 1; k < n && i + k < s.size(); ++k) cp = (cp << 6) | (static_cast<unsigned char>(s[i + k]) & 0x3F);
+ const bool ok = cp == '\n' || (cp >= 0x20 && cp <= 0x7E) || (cp >= 0xA0 && cp <= 0xFF) || (cp >= 0xE000 && cp <= 0xF8FF);
+ if (!ok) {
+ std::printf(" U+%04X is not in the UI font: \"%s\"\n", cp, e.translated);
+ ++outside;
+ }
+ i += n;
+ }
+ }
+ CHECK(outside == 0);
+}
diff --git a/tests/ui/language.sfui b/tests/ui/language.sfui
new file mode 100644
index 00000000..33045392
--- /dev/null
+++ b/tests/ui/language.sfui
@@ -0,0 +1,69 @@
+# The interface language (#44), Preferences > Interface > Language: Español translates the palette bar, the
+# palettes, the shelves and the Ctrl-help; brush and tool names (SubTool, QRemesh, Clay Buildup) stay as they are.
+# The "##" ids don't change, so every button works the same in either language, and English comes back unchanged.
+run new_sphere subdivisions=2
+click "Preferences##palette.preferences"
+click "Interface##preferences.interface"
+expect_text "Language"
+expect "English##language.en"
+click "Español##language.es"
+expect_text "Idioma"
+expect "Preferencias##palette.preferences"
+expect "Interfaz##preferences.interface"
+expect "Entrada##preferences.input"
+expect_text "Escala de la interfaz"
+expect_no_text "Popup Info opacity"
+shot preferencias
+key escape
+
+# The palette bar, the top shelf and the right shelf in Spanish (the brushes on the bottom shelf keep their names).
+expect "Archivo##palette.file"
+expect "Herramienta##palette.tool"
+expect "Dibujar##tool.draw"
+expect "Mover##tool.move"
+expect_text "Tamaño de dibujo"
+expect_text "Intensidad Z"
+expect "ClayBuildup##brush.claybuildup"
+expect "Move##brush.move"
+expect "SubTool##tool.subtool"
+
+# Tool > Geometry: the translated Divide divides.
+click "Geometría##tool.geometry"
+expect_value sdiv_levels == 0
+expect_text "Sin niveles de subdivisión"
+click "Dividir##geometry.divide"
+expect_value sdiv_levels == 2
+expect "Res. menor##geometry.lower_res"
+shot geometria
+click "Geometría##tool.geometry"
+
+# Tool > Masking: translated buttons run their commands.
+click "Enmascarado##tool.masking"
+click "Todo##mask"
+expect_value masked > 0
+click "Borrar##mask"
+expect_value masked == 0
+click "Enmascarado##tool.masking"
+
+# Ctrl-help in Spanish: the action's name and where it lives.
+hold ctrl
+hover "Dibujar##tool.draw"
+expect_help "Dibujar"
+hold none
+
+# The command palette finds commands by their Spanish names too.
+key f3
+type "##Command palette" Dividir
+expect "Dividir##pal.geometry.divide"
+key escape
+
+# Back to English: the same items with their English labels.
+click "Preferencias##palette.preferences"
+click "English##language.en"
+expect "Preferences##palette.preferences"
+expect_text "Language"
+expect_no_text "Idioma"
+key escape
+expect "Geometry##tool.geometry"
+expect "Draw##tool.draw"
+expect_text "Draw Size"