From c25c984395ad379a51bef33871bbd77b6e97f197 Mon Sep 17 00:00:00 2001
From: Kirill M <176898419+JaffarSk24@users.noreply.github.com>
Date: Thu, 19 Nov 2026 21:13:17 +0100
Subject: [PATCH 01/11] i18n: offer Russian
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
LANGUAGES gains ru (Русский); ru-RU, ru-SK and ru_RU.UTF-8 resolve to it. Its texturecraft.tsv catalog comes from craft-i18n; Cyrillic is drawn by egui's built-in fonts. Docs list eleven languages.
---
ROADMAP.md | 5 +++--
crates/ui-egui/src/fonts.rs | 6 ++++--
crates/ui-egui/src/i18n.rs | 5 +++--
docs/features.md | 4 ++--
docs/localization-parity.md | 1 +
5 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/ROADMAP.md b/ROADMAP.md
index 759dfde7..4ff0ad33 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -95,7 +95,7 @@ incomplete validation; they are not measured success rates or speed comparisons.
| UI/UX fidelity | ~65% | 20 | TBD | Current editing/bake/export UI checked; [gaps](docs/ui-parity.md), ArtCraft UI adoption and revalidation after refactoring remain |
| File formats / interchange | ~60% | 10 | TBD | Current native save and basic exports exercised; possible `.tcraft`/output-package reworks, unfinished upstream `.mcmat`, `.spp` and consumer validation remain |
| Hardware (GPU, pen, displays) | ~50% | 8 | TBD | One Windows GPU exercised; pen tilt, pressure across platforms and display coverage remain incomplete |
-| Localization | ~35% | 4 | TBD | Ten picker languages in source; optional shared catalogs/fonts and native-language review need current measurement |
+| Localization | ~35% | 4 | TBD | Eleven picker languages in source; optional shared catalogs/fonts and native-language review need current measurement |
| Performance | ~40% | 10 | TBD | Dirty-tile/budgeted architecture and benchmark code exist; no matched performance budgets or large-project results from this review |
| Stability | ~55% | 10 | TBD | Small save/reopen and undo/redo passed; recovery, large projects and long sessions need coverage, including after format/library migrations |
| Platforms | ~65% | 3 | TBD | Desktop/web build and packaging paths exist; this review ran Windows only |
@@ -158,7 +158,7 @@ exist; older reports must not turn them into fresh missing-feature claims.
## Languages
-The [picker](crates/ui-egui/src/i18n.rs) contains ten languages. Shared catalogs are optional at
+The [picker](crates/ui-egui/src/i18n.rs) contains eleven languages. Shared catalogs are optional at
build time; missing entries fall back to English, and builds without catalogs offer English only.
The older [coverage table](docs/localization-parity.md) predates catalog migration, so its “100%”
rows are not a current measurement. This audit ran an English build without external catalogs.
@@ -170,6 +170,7 @@ rows are not a current measurement. This audit ran an English build without exte
| Spanish | `es` | Not remeasured | Catalog dependent; native review pending |
| Hindi | `hi` | No picker entry | Not offered |
| Arabic | `ar` | Not remeasured | Catalog/font dependent; shaping/layout needs current review |
+| Russian | `ru` | Catalog dependent | Added with the craft-i18n `ru/texturecraft.tsv` catalog; reviewed by a native speaker |
| French | `fr` | Not remeasured | Catalog dependent; native review pending |
| Portuguese (Brazil) | `pt-BR` | Not remeasured | Catalog dependent; native review pending |
| Indonesian | `id` | No picker entry | Not offered |
diff --git a/crates/ui-egui/src/fonts.rs b/crates/ui-egui/src/fonts.rs
index b31b423a..6f11efec 100644
--- a/crates/ui-egui/src/fonts.rs
+++ b/crates/ui-egui/src/fonts.rs
@@ -278,9 +278,11 @@ mod tests {
assert_eq!(Script::of_language("ko"), Some(Script::Korean));
assert_eq!(Script::of_language("ar"), Some(Script::Arabic));
assert_eq!(Script::of_language("de"), None);
+ assert_eq!(Script::of_language("ru"), None);
for l in &crate::i18n::LANGUAGES {
- // Past the Latin blocks and their diacritics.
- let other_script = l.name.chars().any(|c| c > '\u{036F}');
+ // Past the Latin blocks and their diacritics. Cyrillic needs no fallback: the UI fonts
+ // themselves carry it (egui's Ubuntu and craft-fonts' Inter).
+ let other_script = l.name.chars().any(|c| c > '\u{036F}' && !('\u{0400}'..='\u{04FF}').contains(&c));
assert_eq!(other_script, Script::of_language(l.code).is_some(), "{}", l.code);
}
}
diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs
index bbbea0ec..fe1cca17 100644
--- a/crates/ui-egui/src/i18n.rs
+++ b/crates/ui-egui/src/i18n.rs
@@ -37,7 +37,7 @@ pub struct Language {
pub english: &'static str,
}
-const COUNT: usize = 10;
+const COUNT: usize = 11;
pub static LANGUAGES: [Language; COUNT] = [
Language { code: "en", name: "English", english: "English" },
@@ -46,6 +46,7 @@ pub static LANGUAGES: [Language; COUNT] = [
Language { code: "es", name: "Español", english: "Spanish" },
Language { code: "pt-BR", name: "Português (Brasil)", english: "Portuguese (Brazil)" },
Language { code: "it", name: "Italiano", english: "Italian" },
+ Language { code: "ru", name: "Русский", english: "Russian" },
Language { code: "ja", name: "日本語", english: "Japanese" },
Language { code: "zh-Hans", name: "简体中文", english: "Chinese (Simplified)" },
Language { code: "ko", name: "한국어", english: "Korean" },
@@ -386,7 +387,7 @@ mod tests",
assert_eq!(trf("{a} of {b} {c}", &[("a", &1), ("b", &2)]), "1 of 2 {c}");
assert_eq!(trf("{unclosed", &[]), "{unclosed");
for (locale, code) in
- [("de-AT", "de"), ("pt_PT.UTF-8", "pt-BR"), ("zh-Hant-TW", "zh-Hans"), ("ja", "ja"), ("ko_KR", "ko"), ("ar-EG", "ar"), ("nl-NL", "en"), ("", "en")]
+ [("de-AT", "de"), ("pt_PT.UTF-8", "pt-BR"), ("zh-Hant-TW", "zh-Hans"), ("ja", "ja"), ("ko_KR", "ko"), ("ar-EG", "ar"), ("ru-SK", "ru"), ("ru_RU.UTF-8", "ru"), ("nl-NL", "en"), ("", "en")]
{
assert_eq!(language_for_locale(locale), code, "{locale}");
}
diff --git a/docs/features.md b/docs/features.md
index 79bae167..1a66c200 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -260,8 +260,8 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA
channel to a text file with each entry's recorded UTC time, severity and source. The desktop app asks
for a destination, and the browser downloads the file.
- A **History** panel: click any step to go back to it, or forward again to an undone one.
-- **10 languages:** English, French, German, Spanish, Portuguese, Italian, Japanese, Chinese,
- Korean and Arabic, switchable live.
+- **11 languages:** English, French, German, Spanish, Portuguese, Italian, Russian, Japanese,
+ Chinese, Korean and Arabic, switchable live.
- **In the browser:** the same app compiled to WebAssembly, on WebGPU or WebGL2, with touch
navigation and project open, save and download.
diff --git a/docs/localization-parity.md b/docs/localization-parity.md
index fb6a8a49..3625d0cd 100644
--- a/docs/localization-parity.md
+++ b/docs/localization-parity.md
@@ -29,6 +29,7 @@ generator, filter and brush alpha names (**KEYS** strings, counted by the
| Arabic | `ar` | KEYS (100%) | yes | Arabic glyphs: craft-fonts (Noto Sans Arabic) or system fonts on desktop; egui shapes the text and orders it right to left (panels keep the left-to-right layout) | yes | full | 0 h |
| French | `fr` | KEYS (100%) | yes | Latin | no | full | 1 h (review) |
| Portuguese (Brazil) | `pt-BR` | KEYS (100%) | yes | Latin | no | full | 1 h (review) |
+| Russian | `ru` | KEYS (~99%) | yes | Cyrillic: egui's built-in fonts | yes | full with the craft-i18n `ru/texturecraft.tsv` catalog | 0 h |
| Indonesian | `id` | 0 | no | Latin | no | none | 3 h |
| Japanese | `ja` | KEYS (100%) | yes | CJK glyphs: craft-fonts (BIZ UDPGothic) or system fonts on desktop | no | full | 2 h (review) |
| German | `de` | KEYS (100%) | yes | Latin | no | full | 1 h (review) |
From ab13dc9870bdd5251497031c37a98a72937b8926 Mon Sep 17 00:00:00 2001
From: Kirill M <176898419+JaffarSk24@users.noreply.github.com>
Date: Thu, 19 Nov 2026 23:09:28 +0100
Subject: [PATCH 02/11] i18n: format the locale test; features.md says a build
without catalogs offers English only
---
crates/ui-egui/src/i18n.rs | 15 ++++++++++++---
docs/features.md | 3 ++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs
index fe1cca17..a0697be5 100644
--- a/crates/ui-egui/src/i18n.rs
+++ b/crates/ui-egui/src/i18n.rs
@@ -386,9 +386,18 @@ mod tests",
assert_eq!(trf("Saved {path}", &[("path", &"a.tcraft")]), "Saved a.tcraft");
assert_eq!(trf("{a} of {b} {c}", &[("a", &1), ("b", &2)]), "1 of 2 {c}");
assert_eq!(trf("{unclosed", &[]), "{unclosed");
- for (locale, code) in
- [("de-AT", "de"), ("pt_PT.UTF-8", "pt-BR"), ("zh-Hant-TW", "zh-Hans"), ("ja", "ja"), ("ko_KR", "ko"), ("ar-EG", "ar"), ("ru-SK", "ru"), ("ru_RU.UTF-8", "ru"), ("nl-NL", "en"), ("", "en")]
- {
+ for (locale, code) in [
+ ("de-AT", "de"),
+ ("pt_PT.UTF-8", "pt-BR"),
+ ("zh-Hant-TW", "zh-Hans"),
+ ("ja", "ja"),
+ ("ko_KR", "ko"),
+ ("ar-EG", "ar"),
+ ("ru-SK", "ru"),
+ ("ru_RU.UTF-8", "ru"),
+ ("nl-NL", "en"),
+ ("", "en"),
+ ] {
assert_eq!(language_for_locale(locale), code, "{locale}");
}
set_language("de");
diff --git a/docs/features.md b/docs/features.md
index 1a66c200..220eadf2 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -261,7 +261,8 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA
for a destination, and the browser downloads the file.
- A **History** panel: click any step to go back to it, or forward again to an undone one.
- **11 languages:** English, French, German, Spanish, Portuguese, Italian, Russian, Japanese,
- Chinese, Korean and Arabic, switchable live.
+ Chinese, Korean and Arabic, switchable live. A build without the shared craft-i18n catalogs
+ offers English only.
- **In the browser:** the same app compiled to WebAssembly, on WebGPU or WebGL2, with touch
navigation and project open, save and download.
From 025aff43182c6b0c3fc3795a9d91739c0856c50e Mon Sep 17 00:00:00 2001
From: Kirill M <176898419+JaffarSk24@users.noreply.github.com>
Date: Thu, 19 Nov 2026 23:09:29 +0100
Subject: [PATCH 03/11] tests: pin the UI harnesses to English
The app starts in the system language and these tests find controls by their English labels, so on a machine whose language TextureCraft offers they failed. Each harness built around TextureCraftApp now sets prefs.language to en right after it is built, as rail.rs and settings_window.rs already did; the toolbar-only harnesses, which never run a full frame, set the language directly. ui_state_persistence keeps the saved state it tests.
---
crates/ui-egui/tests/bake_preview.rs | 2 ++
crates/ui-egui/tests/brush_cursor_2d.rs | 2 ++
crates/ui-egui/tests/it/bake_job_mesh.rs | 2 ++
crates/ui-egui/tests/it/bake_mode.rs | 4 ++++
crates/ui-egui/tests/it/bake_presets.rs | 3 +++
crates/ui-egui/tests/it/brush_drag.rs | 3 +++
crates/ui-egui/tests/it/camera_views.rs | 3 +++
crates/ui-egui/tests/it/clone_source_view.rs | 2 ++
crates/ui-egui/tests/it/close_unsaved.rs | 2 ++
crates/ui-egui/tests/it/color_selection_editor.rs | 3 +++
crates/ui-egui/tests/it/curvature_generator.rs | 2 ++
crates/ui-egui/tests/it/effect_rows.rs | 4 ++++
crates/ui-egui/tests/it/effect_sliders.rs | 3 +++
crates/ui-egui/tests/it/export_template_guards.rs | 2 ++
crates/ui-egui/tests/it/file_dialogs.rs | 2 ++
crates/ui-egui/tests/it/filter_picker.rs | 3 +++
crates/ui-egui/tests/it/frame_selection.rs | 2 ++
crates/ui-egui/tests/it/generator_panel.rs | 2 ++
crates/ui-egui/tests/it/history_panel.rs | 3 +++
crates/ui-egui/tests/it/import_resources.rs | 1 +
crates/ui-egui/tests/it/inactive_set_hint.rs | 2 ++
crates/ui-egui/tests/it/layer_blending_options.rs | 2 ++
crates/ui-egui/tests/it/layer_clipboard.rs | 3 +++
crates/ui-egui/tests/it/layer_multi_select.rs | 2 ++
crates/ui-egui/tests/it/layer_rename.rs | 2 ++
crates/ui-egui/tests/it/layers_panel.rs | 3 +++
crates/ui-egui/tests/it/levels_editor.rs | 2 ++
crates/ui-egui/tests/it/mask_export.rs | 2 ++
crates/ui-egui/tests/it/mask_value_swap.rs | 2 ++
crates/ui-egui/tests/it/named_layouts.rs | 2 ++
crates/ui-egui/tests/it/nav_buttons.rs | 2 ++
crates/ui-egui/tests/it/new_project_baked_maps.rs | 3 +++
crates/ui-egui/tests/it/path_in_view.rs | 4 ++++
crates/ui-egui/tests/it/path_list.rs | 2 ++
crates/ui-egui/tests/it/pen_pressure.rs | 2 ++
crates/ui-egui/tests/it/polygon_fill.rs | 3 +++
crates/ui-egui/tests/it/project_config.rs | 1 +
crates/ui-egui/tests/it/properties_popup.rs | 2 ++
crates/ui-egui/tests/it/shelf_click.rs | 2 ++
crates/ui-egui/tests/it/shelf_drop.rs | 2 ++
crates/ui-egui/tests/it/shelf_hover_preview.rs | 2 ++
crates/ui-egui/tests/it/shelf_panel.rs | 2 ++
crates/ui-egui/tests/it/shift_lines_2d.rs | 3 +++
crates/ui-egui/tests/it/shift_lines_3d.rs | 2 ++
crates/ui-egui/tests/it/shortcut_keys.rs | 2 ++
crates/ui-egui/tests/it/skew_paint.rs | 2 ++
crates/ui-egui/tests/it/smudge_channels.rs | 2 ++
crates/ui-egui/tests/it/snapped_lines.rs | 2 ++
crates/ui-egui/tests/it/split_divider.rs | 2 ++
crates/ui-egui/tests/it/symmetry.rs | 2 ++
crates/ui-egui/tests/it/symmetry_2d.rs | 2 ++
crates/ui-egui/tests/it/tool_availability.rs | 4 ++++
crates/ui-egui/tests/it/tool_settings_saved.rs | 2 ++
crates/ui-egui/tests/it/toolbar.rs | 7 +++++++
crates/ui-egui/tests/it/user_smart_mask.rs | 2 ++
crates/ui-egui/tests/list_panels.rs | 3 +++
56 files changed, 136 insertions(+)
diff --git a/crates/ui-egui/tests/bake_preview.rs b/crates/ui-egui/tests/bake_preview.rs
index 1703abde..9e00f082 100644
--- a/crates/ui-egui/tests/bake_preview.rs
+++ b/crates/ui-egui/tests/bake_preview.rs
@@ -20,6 +20,8 @@ fn harness() -> Harness<'static, TextureCraftApp> {
session.view = ViewMode::UvChecker;
let mut harness = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).build_eframe(|context| TextureCraftApp::new(context, session));
+ // The labels below are English; a first run would speak the system's language
+ harness.state_mut().ui.prefs.language = "en".into();
harness.state_mut().ui.mode = Mode::Baking;
harness.run_steps(3);
harness
diff --git a/crates/ui-egui/tests/brush_cursor_2d.rs b/crates/ui-egui/tests/brush_cursor_2d.rs
index 6c54d052..323b7924 100644
--- a/crates/ui-egui/tests/brush_cursor_2d.rs
+++ b/crates/ui-egui/tests/brush_cursor_2d.rs
@@ -10,6 +10,8 @@ use texturecraft_ui_egui::state::{Mode, ViewLayout};
fn harness() -> Harness<'static, TextureCraftApp> {
let session = texturecraft_engine::sample_session(256, 64).unwrap();
let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 960.0)).build_eframe(|context| TextureCraftApp::new(context, session));
+ // The labels below are English; a first run would speak the system's language
+ harness.state_mut().ui.prefs.language = "en".into();
harness.state_mut().ui.layout = ViewLayout::Only2D;
harness.run_steps(4);
harness
diff --git a/crates/ui-egui/tests/it/bake_job_mesh.rs b/crates/ui-egui/tests/it/bake_job_mesh.rs
index 60f6f03e..6d166d46 100644
--- a/crates/ui-egui/tests/it/bake_job_mesh.rs
+++ b/crates/ui-egui/tests/it/bake_job_mesh.rs
@@ -12,6 +12,8 @@ use texturecraft_ui_egui::{BakeJob, RunningBake, TextureCraftApp};
fn harness_with_job(mesh_id: impl FnOnce(u64) -> u64) -> (Harness<'static, TextureCraftApp>, Arc
+
+ TextureCraft — открытая нативная программа для рисования 3D-текстур, устроенная так,
+ как привыкли художники по текстурам: знакомые меню, сочетания клавиш, панели и
+ инструменты, а наборы текстур, слои, маски, заливки и эффекты наносятся прямо на
+ модель.
+
- Open glTF/GLB, FBX, COLLADA, USD (USDA/USDC/USDZ), Alembic, OBJ, PLY and STL meshes and save projects as .tcraft
+ - Открытие сеток glTF/GLB, FBX, COLLADA, USD (USDA/USDC/USDZ), Alembic, OBJ, PLY и STL и сохранение проектов в .tcraft
- Paint base colour, roughness, metallic, normal and height together with PBR brushes
+ - Рисование базового цвета, шероховатости, металличности, нормалей и высоты одновременно с помощью PBR-кистей
- Bake mesh maps and export texture sets as PNG, EXR, TGA, JPEG or TIFF
+ - Запекание карт сетки и экспорт наборов текстур в PNG, EXR, TGA, JPEG или TIFF
- Every action is a command, scriptable from a CLI and a JSON control channel
+ - Каждое действие — это команда, которую можно вызывать из CLI и через управляющий канал JSON
ai.storyteller.texturecraft.desktop
@@ -36,9 +47,13 @@
texture painting
+ рисование текстур
pbr
+ pbr
3d
+ 3d
mesh
+ сетка
#f0c39c
diff --git a/packaging/linux/ai.storyteller.texturecraft.mime.xml b/packaging/linux/ai.storyteller.texturecraft.mime.xml
index cf5204b3..2b1b811e 100644
--- a/packaging/linux/ai.storyteller.texturecraft.mime.xml
+++ b/packaging/linux/ai.storyteller.texturecraft.mime.xml
@@ -1,16 +1,19 @@
+
TextureCraft project
+ Проект TextureCraft
glTF binary model
+ Двоичная модель glTF
@@ -18,11 +21,13 @@
glTF model
+ Модель glTF
FBX model
+ Модель FBX
@@ -30,11 +35,13 @@
COLLADA model
+ Модель COLLADA
Universal Scene Description
+ Universal Scene Description
@@ -44,17 +51,20 @@
Universal Scene Description (text)
+ Universal Scene Description (текст)
Universal Scene Description package
+ Пакет Universal Scene Description
Alembic model
+ Модель Alembic
@@ -62,11 +72,13 @@
Wavefront OBJ model
+ Модель Wavefront OBJ
PLY model
+ Модель PLY
@@ -75,6 +87,7 @@
STL model
+ Модель STL
From e4585fb2b34234e7a5f4b58ee0db1f744e500048 Mon Sep 17 00:00:00 2001
From: supersfera
Date: Sat, 21 Nov 2026 20:23:02 -0800
Subject: [PATCH 05/11] ru: update language-script test for Cyrillic
---
crates/ui-egui/src/fonts.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/crates/ui-egui/src/fonts.rs b/crates/ui-egui/src/fonts.rs
index b31b423a..5a5eb801 100644
--- a/crates/ui-egui/src/fonts.rs
+++ b/crates/ui-egui/src/fonts.rs
@@ -279,8 +279,9 @@ mod tests {
assert_eq!(Script::of_language("ar"), Some(Script::Arabic));
assert_eq!(Script::of_language("de"), None);
for l in &crate::i18n::LANGUAGES {
- // Past the Latin blocks and their diacritics.
- let other_script = l.name.chars().any(|c| c > '\u{036F}');
+ // Past the Latin blocks and their diacritics. Cyrillic is already in the
+ // interface font (Inter / Ubuntu-Light), so Russian needs no fallback script.
+ let other_script = l.name.chars().any(|c| c > '\u{036F}' && !('\u{0400}'..='\u{04FF}').contains(&c));
assert_eq!(other_script, Script::of_language(l.code).is_some(), "{}", l.code);
}
}
From 7f6375bf98716f0c93d1d422dcf7edc41c9962ca Mon Sep 17 00:00:00 2001
From: supersfera
Date: Tue, 24 Nov 2026 07:10:16 -0800
Subject: [PATCH 06/11] ru: state CC0-1.0 for Russian metainfo strings
---
packaging/linux/ai.storyteller.texturecraft.metainfo.xml.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/packaging/linux/ai.storyteller.texturecraft.metainfo.xml.in b/packaging/linux/ai.storyteller.texturecraft.metainfo.xml.in
index 9b14d960..65088b0f 100644
--- a/packaging/linux/ai.storyteller.texturecraft.metainfo.xml.in
+++ b/packaging/linux/ai.storyteller.texturecraft.metainfo.xml.in
@@ -1,4 +1,5 @@
+
From ed5bb4ed697a72c8333209f0826d7488d7aa9ba9 Mon Sep 17 00:00:00 2001
From: supersfera
Date: Thu, 26 Nov 2026 12:58:03 -0800
Subject: [PATCH 07/11] ru: remove the per-file translation notices
The translation is under the repository's licence, and authorship is in git history.
---
packaging/linux/ai.storyteller.texturecraft.desktop | 1 -
packaging/linux/ai.storyteller.texturecraft.mime.xml | 1 -
2 files changed, 2 deletions(-)
diff --git a/packaging/linux/ai.storyteller.texturecraft.desktop b/packaging/linux/ai.storyteller.texturecraft.desktop
index e1cb409a..07ebda06 100644
--- a/packaging/linux/ai.storyteller.texturecraft.desktop
+++ b/packaging/linux/ai.storyteller.texturecraft.desktop
@@ -1,4 +1,3 @@
-# Russian translation © 2026 SuperSfera LLC, MIT OR Apache-2.0
[Desktop Entry]
Type=Application
Name=TextureCraft
diff --git a/packaging/linux/ai.storyteller.texturecraft.mime.xml b/packaging/linux/ai.storyteller.texturecraft.mime.xml
index 2b1b811e..cb7c1b99 100644
--- a/packaging/linux/ai.storyteller.texturecraft.mime.xml
+++ b/packaging/linux/ai.storyteller.texturecraft.mime.xml
@@ -1,5 +1,4 @@
-
From 9e2917098f7ecdc200afeb48741179c6a85e0a43 Mon Sep 17 00:00:00 2001
From: a2
Date: Thu, 26 Nov 2026 19:54:14 -0500
Subject: [PATCH 08/11] chore(i18n): leave the language registration to #691;
keep the Russian packaging metadata
Co-Authored-By: Claude Sonnet 5.5
---
crates/ui-egui/src/fonts.rs | 5 ++---
crates/ui-egui/src/i18n.rs | 3 +--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/crates/ui-egui/src/fonts.rs b/crates/ui-egui/src/fonts.rs
index b9f5530f..95080619 100644
--- a/crates/ui-egui/src/fonts.rs
+++ b/crates/ui-egui/src/fonts.rs
@@ -279,9 +279,8 @@ mod tests {
assert_eq!(Script::of_language("ar"), Some(Script::Arabic));
assert_eq!(Script::of_language("de"), None);
for l in &crate::i18n::LANGUAGES {
- // Past the Latin blocks and their diacritics. Cyrillic is already in the
- // interface font (Inter / Ubuntu-Light), so Russian needs no fallback script.
- let other_script = l.name.chars().any(|c| c > '\u{036F}' && !('\u{0400}'..='\u{04FF}').contains(&c));
+ // Past the Latin blocks and their diacritics.
+ let other_script = l.name.chars().any(|c| c > '\u{036F}');
assert_eq!(other_script, Script::of_language(l.code).is_some(), "{}", l.code);
}
}
diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs
index be1da30c..2210638e 100644
--- a/crates/ui-egui/src/i18n.rs
+++ b/crates/ui-egui/src/i18n.rs
@@ -37,7 +37,7 @@ pub struct Language {
pub english: &'static str,
}
-const COUNT: usize = 11;
+const COUNT: usize = 10;
pub static LANGUAGES: [Language; COUNT] = [
Language { code: "en", name: "English", english: "English" },
@@ -50,7 +50,6 @@ pub static LANGUAGES: [Language; COUNT] = [
Language { code: "zh-Hans", name: "简体中文", english: "Chinese (Simplified)" },
Language { code: "ko", name: "한국어", english: "Korean" },
Language { code: "ar", name: "العربية", english: "Arabic" },
- Language { code: "ru", name: "Русский", english: "Russian" },
];
// Rendering and preferences use the UI thread, including independent test harnesses.
From beea46c9e22126681df3ddbc7884fb424fb979b5 Mon Sep 17 00:00:00 2001
From: a2
Date: Thu, 26 Nov 2026 21:00:18 -0500
Subject: [PATCH 09/11] fix(engine): Open in MaterialCraft stages its package
in a private folder
The button wrote /.mcraft with a plain fs::write. On a shared temp
folder another local user could plant a file or link at that guessable name
first, and the write went through it. The package now goes into a new random
folder made exclusively (0700 on Unix), as a create_new file; folders over a
week old are swept.
Co-Authored-By: Claude Sonnet 5.5
---
crates/engine/src/link_cmds.rs | 130 +++++++++++++++++++++++++++++++++
crates/ui-egui/src/dock.rs | 6 +-
2 files changed, 133 insertions(+), 3 deletions(-)
diff --git a/crates/engine/src/link_cmds.rs b/crates/engine/src/link_cmds.rs
index a20182f6..f22b0f6e 100644
--- a/crates/engine/src/link_cmds.rs
+++ b/crates/engine/src/link_cmds.rs
@@ -344,6 +344,59 @@ pub fn open_in_materialcraft(package: &std::path::Path) -> Result<()> {
})
}
+/// Prefix of the folders [`stage_handoff_package`] makes in the temp folder.
+#[cfg(not(target_arch = "wasm32"))]
+const HANDOFF_PREFIX: &str = "texturecraft-open-";
+
+/// Folders from earlier hand-offs older than this are removed (MaterialCraft may still have a young one open).
+#[cfg(not(target_arch = "wasm32"))]
+const HANDOFF_MAX_AGE: std::time::Duration = std::time::Duration::from_secs(7 * 24 * 3600);
+
+/// Write `package` as `file_name` inside a new folder only this call can have made under the temp folder, and return the
+/// file's path (for [`open_in_materialcraft`]). A fixed `/` is guessable: on a shared `/tmp` another user
+/// could plant a file or link there first and the write would go through it. The folder name is random, is created
+/// exclusively (mode `0700` on Unix) and the file is created with `create_new`, so nothing planted is ever written through.
+/// The folder stays after the call because MaterialCraft needs the file while it is open; folders over a week old go.
+#[cfg(not(target_arch = "wasm32"))]
+pub fn stage_handoff_package(file_name: &str, package: &[u8]) -> Result {
+ stage_handoff_package_in(&std::env::temp_dir(), file_name, package)
+}
+
+#[cfg(not(target_arch = "wasm32"))]
+fn stage_handoff_package_in(base: &std::path::Path, file_name: &str, package: &[u8]) -> Result {
+ use std::io::Write;
+ let io = |e: std::io::Error| EngineError::Other(format!("cannot stage the package for MaterialCraft: {e}"));
+ if file_name.is_empty() || std::path::Path::new(file_name).file_name() != Some(std::ffi::OsStr::new(file_name)) {
+ return Err(EngineError::Other(format!("`{file_name}` is not a plain file name")));
+ }
+ sweep_old_handoffs(base, HANDOFF_MAX_AGE);
+ // Dropped (and removed) on any early return, so a failed write leaves no empty folder behind.
+ let dir = tempfile::Builder::new().prefix(HANDOFF_PREFIX).tempdir_in(base).map_err(io)?;
+ let path = dir.path().join(file_name);
+ let mut file = std::fs::OpenOptions::new().write(true).create_new(true).open(&path).map_err(io)?;
+ file.write_all(package).map_err(io)?;
+ file.sync_all().map_err(io)?;
+ let _ = dir.keep();
+ Ok(path)
+}
+
+/// Remove hand-off folders in `base` last changed more than `max_age` ago. Only real folders with our prefix are
+/// touched (never a link), and every failure is ignored: a leftover folder costs disk space, not work.
+#[cfg(not(target_arch = "wasm32"))]
+fn sweep_old_handoffs(base: &std::path::Path, max_age: std::time::Duration) {
+ let Ok(entries) = std::fs::read_dir(base) else { return };
+ for entry in entries.flatten() {
+ if !entry.file_name().to_string_lossy().starts_with(HANDOFF_PREFIX) {
+ continue;
+ }
+ let Ok(meta) = std::fs::symlink_metadata(entry.path()) else { continue };
+ let old = meta.modified().ok().and_then(|t| t.elapsed().ok()).is_some_and(|age| age > max_age);
+ if meta.is_dir() && old {
+ let _ = std::fs::remove_dir_all(entry.path());
+ }
+ }
+}
+
/// Source file extensions are chosen from the linked resource name, never an untrusted path.
pub fn source_extension(name: &str) -> &'static str {
if name.to_ascii_lowercase().ends_with(".mcmat") {
@@ -711,4 +764,81 @@ mod tests {
assert_eq!(typed(&p, &json!("#+f+f+f")), None);
assert!(typed(&p, &json!("#ff8000")).is_some());
}
+
+ #[cfg(not(target_arch = "wasm32"))]
+ fn scratch(name: &str) -> std::path::PathBuf {
+ let dir = std::env::temp_dir().join(format!("tc_handoff_{name}_{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir_all(&dir).unwrap();
+ dir
+ }
+
+ /// A file another user planted at the old, guessable `/` is never written through.
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn handoff_package_is_not_written_through_a_planted_link() {
+ let base = scratch("planted");
+ let victim = base.join("victim.txt");
+ std::fs::write(&victim, b"precious").unwrap();
+ // The old code wrote `/` with `fs::write`; a hard link there reaches the victim on every platform.
+ std::fs::hard_link(&victim, base.join("wood.mcraft")).unwrap();
+
+ let path = super::stage_handoff_package_in(&base, "wood.mcraft", b"package").unwrap();
+
+ assert_eq!(std::fs::read(&victim).unwrap(), b"precious");
+ assert_eq!(std::fs::read(&path).unwrap(), b"package");
+ assert_ne!(path.parent().unwrap(), base, "the file is inside a folder of its own");
+ std::fs::remove_dir_all(&base).unwrap();
+ }
+
+ /// Every hand-off gets its own empty-until-written folder, even when the name repeats.
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn handoff_packages_get_distinct_folders() {
+ let base = scratch("distinct");
+ let a = super::stage_handoff_package_in(&base, "m.mcraft", b"a").unwrap();
+ let b = super::stage_handoff_package_in(&base, "m.mcraft", b"b").unwrap();
+ assert_ne!(a.parent(), b.parent());
+ assert_eq!((std::fs::read(&a).unwrap(), std::fs::read(&b).unwrap()), (b"a".to_vec(), b"b".to_vec()));
+ #[cfg(unix)]
+ {
+ use std::os::unix::fs::PermissionsExt;
+ assert_eq!(std::fs::metadata(a.parent().unwrap()).unwrap().permissions().mode() & 0o777, 0o700);
+ }
+ std::fs::remove_dir_all(&base).unwrap();
+ }
+
+ /// A name with a path in it cannot leave the new folder.
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn handoff_package_rejects_names_that_are_paths() {
+ let base = scratch("names");
+ for bad in ["", "..", "a/b.mcraft", "../x.mcraft"] {
+ assert!(super::stage_handoff_package_in(&base, bad, b"x").is_err(), "{bad}");
+ }
+ assert_eq!(std::fs::read_dir(&base).unwrap().count(), 0, "a rejected name leaves nothing behind");
+ std::fs::remove_dir_all(&base).unwrap();
+ }
+
+ /// Old hand-off folders are swept; young ones, other folders and files stay.
+ #[cfg(not(target_arch = "wasm32"))]
+ #[test]
+ fn handoff_sweep_removes_only_old_handoff_folders() {
+ let base = scratch("sweep");
+ let old = base.join("texturecraft-open-old");
+ let other = base.join("somebody-elses-folder");
+ let file = base.join("texturecraft-open-file");
+ for dir in [&old, &other] {
+ std::fs::create_dir(dir).unwrap();
+ }
+ std::fs::write(&file, b"x").unwrap();
+ // Zero age limit: everything with the prefix that is a folder counts as old.
+ super::sweep_old_handoffs(&base, std::time::Duration::ZERO);
+ assert!(!old.exists() && other.exists() && file.exists());
+ let young = base.join("texturecraft-open-young");
+ std::fs::create_dir(&young).unwrap();
+ super::sweep_old_handoffs(&base, std::time::Duration::from_secs(3600));
+ assert!(young.exists());
+ std::fs::remove_dir_all(&base).unwrap();
+ }
}
diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs
index a59a5f4d..9d79bf30 100644
--- a/crates/ui-egui/src/dock.rs
+++ b/crates/ui-egui/src/dock.rs
@@ -2787,12 +2787,12 @@ fn fill_properties(app: &mut TextureCraftApp, ui: &mut Ui, layer: &Layer) {
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn open_link_in_materialcraft(app: &mut TextureCraftApp, layer: LayerId, link: &texturecraft_engine::core::MaterialLink) {
let ext = texturecraft_engine::link_cmds::source_extension(&link.package);
- let path = std::env::temp_dir().join(format!("{}.{ext}", texturecraft_engine::formats::export::sanitize_file_stem(&link.name)));
+ let file_name = format!("{}.{ext}", texturecraft_engine::formats::export::sanitize_file_stem(&link.name));
let opened = app
.session
.link_package(layer)
- .and_then(|package| std::fs::write(&path, package.as_slice()).map_err(|err| texturecraft_engine::EngineError::Other(err.to_string())))
- .and_then(|()| texturecraft_engine::link_cmds::open_in_materialcraft(&path));
+ .and_then(|package| texturecraft_engine::link_cmds::stage_handoff_package(&file_name, package.as_slice()))
+ .and_then(|path| texturecraft_engine::link_cmds::open_in_materialcraft(&path));
match opened {
Ok(()) => app.toast(tr("Opened in MaterialCraft: use File > Send to TextureCraft there to bring your changes back"), false),
Err(e) => app.toast(e.to_string(), true),
From 89a906a5c1b817a50a8b9f19b3fc1dbec090835c Mon Sep 17 00:00:00 2001
From: a2
Date: Thu, 26 Nov 2026 21:17:04 -0500
Subject: [PATCH 10/11] fix(engine): hand-off folder and file get explicit 0700
and 0600 on Unix
tempfile creates folders with the default mode (0755 under the usual umask), so
the 0700 the first version asserted was not what Linux produced. Ask for it, and
for 0600 on the package file. Found by CodeRabbit.
Co-Authored-By: Claude Sonnet 5.5
---
crates/engine/src/link_cmds.rs | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/crates/engine/src/link_cmds.rs b/crates/engine/src/link_cmds.rs
index f22b0f6e..f3cd84ad 100644
--- a/crates/engine/src/link_cmds.rs
+++ b/crates/engine/src/link_cmds.rs
@@ -355,7 +355,7 @@ const HANDOFF_MAX_AGE: std::time::Duration = std::time::Duration::from_secs(7 *
/// Write `package` as `file_name` inside a new folder only this call can have made under the temp folder, and return the
/// file's path (for [`open_in_materialcraft`]). A fixed `/` is guessable: on a shared `/tmp` another user
/// could plant a file or link there first and the write would go through it. The folder name is random, is created
-/// exclusively (mode `0700` on Unix) and the file is created with `create_new`, so nothing planted is ever written through.
+/// exclusively (mode `0700` on Unix) and the file is created with `create_new` (mode `0600`), so nothing planted is ever written through.
/// The folder stays after the call because MaterialCraft needs the file while it is open; folders over a week old go.
#[cfg(not(target_arch = "wasm32"))]
pub fn stage_handoff_package(file_name: &str, package: &[u8]) -> Result {
@@ -371,9 +371,18 @@ fn stage_handoff_package_in(base: &std::path::Path, file_name: &str, package: &[
}
sweep_old_handoffs(base, HANDOFF_MAX_AGE);
// Dropped (and removed) on any early return, so a failed write leaves no empty folder behind.
- let dir = tempfile::Builder::new().prefix(HANDOFF_PREFIX).tempdir_in(base).map_err(io)?;
+ let mut builder = tempfile::Builder::new();
+ builder.prefix(HANDOFF_PREFIX);
+ // tempfile makes folders with the default mode (0755 under the usual umask), so ask for 0700 and 0600 explicitly.
+ #[cfg(unix)]
+ builder.permissions(std::os::unix::fs::PermissionsExt::from_mode(0o700));
+ let dir = builder.tempdir_in(base).map_err(io)?;
let path = dir.path().join(file_name);
- let mut file = std::fs::OpenOptions::new().write(true).create_new(true).open(&path).map_err(io)?;
+ let mut options = std::fs::OpenOptions::new();
+ options.write(true).create_new(true);
+ #[cfg(unix)]
+ std::os::unix::fs::OpenOptionsExt::mode(&mut options, 0o600);
+ let mut file = options.open(&path).map_err(io)?;
file.write_all(package).map_err(io)?;
file.sync_all().map_err(io)?;
let _ = dir.keep();
@@ -804,6 +813,7 @@ mod tests {
{
use std::os::unix::fs::PermissionsExt;
assert_eq!(std::fs::metadata(a.parent().unwrap()).unwrap().permissions().mode() & 0o777, 0o700);
+ assert_eq!(std::fs::metadata(&a).unwrap().permissions().mode() & 0o777, 0o600);
}
std::fs::remove_dir_all(&base).unwrap();
}
From b4e9c175754cd1e9ed9f5b2bcc529948be2eb810 Mon Sep 17 00:00:00 2001
From: Kirill M <176898419+JaffarSk24@users.noreply.github.com>
Date: Fri, 27 Nov 2026 07:16:23 +0100
Subject: [PATCH 11/11] docs: the CJK and Arabic picks need a font for their
script
The language picker greys out a language whose script no available font covers, so a web build with catalogs but without craft-fonts cannot pick Japanese, Chinese, Korean or Arabic.
---
docs/features.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/features.md b/docs/features.md
index 8c2e96d4..76d7ff01 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -297,7 +297,8 @@ Everything TextureCraft does today, by area. What's still missing is in [`ROADMA
- A **History** panel: click any step to go back to it, or forward again to an undone one.
- **11 languages:** English, French, German, Spanish, Portuguese, Italian, Russian, Japanese,
Chinese, Korean and Arabic, switchable live. A build without the shared craft-i18n catalogs
- offers English only.
+ offers English only, and Japanese, Chinese, Korean and Arabic can be picked only where a font
+ for their script is available (craft-fonts or the system's); otherwise they show greyed out.
- **In the browser:** the same app compiled to WebAssembly, on WebGPU or WebGL2, with touch
navigation and project open, save and download.