Files
texturecraft/docs/localization-parity.md
bflatasticandClaude Opus 5.5 55387bf0fd GPU baking, Alembic, templates, translations and 8K responsiveness
- Baking: per-map ray settings (AO, thickness, bent normals), GPU ray-traced baking with CPU
  fallback (~12x), color map from textured glTF high polys
- Files: Alembic (Ogawa) and FBX 6 import, per-tile UDIM resolution, converting a set to UV
  tiles, project templates, preserving painted strokes on mesh reimport
- UI: translations (French, German, Spanish, Portuguese, Italian, Japanese, Chinese, Korean)
  with a live language picker and CJK fonts, closed panels reopen where they were, viewport
  texture resolution setting, frame-budgeted scene sync for 8K sets
- Web: loading screen, WebGL2 notice, app-captured shortcuts, touch navigation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:23:28 +07:00

60 lines
4.0 KiB
Markdown

# Localization
TextureCraft's interface text goes through one lookup, `tr("English text")` in
`crates/ui-egui/src/i18n.rs`: the English string is the key, so English needs no table and a
missing translation falls back to English. Each language is a static `(English, translation)`
table in `crates/ui-egui/src/i18n/<code>.rs`, indexed into a hash map the first time the
language is used. Text with values uses `trf("Saved {path}", &[("path", &p)])`; static labels
that are translated where they are shown are marked with `n_("…")`.
Pick the language in **Edit ▸ Settings ▸ Language** (it switches live). The first run follows
the operating system's language (the browser's in the web build).
## Status
UI strings: every `tr`/`trf`/`n_` literal in `crates/ui-egui/src` plus the menu catalog, panel
names, shortcut editor rows and the engine's channel, blend mode, mesh map, tool, procedural,
generator, filter and brush alpha names (**KEYS** strings, counted by the
`every_key_is_translated_in_every_language` test, which fails when one is missing).
| Language | Code | UI strings | Dialogs, tooltips, help | Script support | Native review | Status | To `full` |
|---|---|---|---|---|---|---|---|
| English | `en` | KEYS (100%) | yes | Latin | yes | full | 0 h |
| Simplified Chinese | `zh-Hans` | KEYS (100%) | yes | CJK glyphs: craft-fonts (Noto Sans CJK SC) or system fonts on desktop; see below | no | full | 2 h (review) |
| Spanish | `es` | KEYS (100%) | yes | Latin | no | full | 1 h (review) |
| Hindi | `hi` | 0 | no | Devanagari shaping: not yet (egui has no complex shaping) | no | none | 12 h |
| Arabic | `ar` | 0 | no | RTL layout and shaping: not yet | no | none | 20 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) |
| 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) |
| Korean | `ko` | KEYS (100%) | yes | Hangul glyphs: system fonts on desktop (craft-fonts has no Korean face yet) | no | full | 2 h (review) |
| Vietnamese | `vi` | 0 | no | Latin with diacritics | no | none | 3 h |
| Italian | `it` | KEYS (100%) | yes | Latin | no | full | 1 h (review) |
Not translated on purpose: asset library names (materials, smart masks, alphas, environments),
user content (layer, texture set, project names), file format and technical names (sRGB8, L16F,
RGB, OpenGL, DirectX), and error details that come from the engine (shown after a translated
"Couldn't …:" prefix).
## Fonts for Chinese, Japanese and Korean
egui's built-in fonts have no CJK glyphs. `crates/ui-egui/src/fonts.rs` adds fallbacks after the
app's own fonts (Latin text and row heights keep the default font), loading them only when the
UI language needs them or the language picker shows every language's own name:
1. **craft-fonts** ([storytold/craft-fonts](https://github.com/storytold/craft-fonts)), embedded at
build time when `CRAFT_FONTS_DIR` points at a checkout (`crates/ui-egui/build.rs`, the recipe in
craft-fonts' `docs/integration.md`; `CRAFT_FONTS_REQUIRED=1` makes it mandatory for releases).
Desktop builds embed BIZ UDPGothic Regular (Japanese) and Noto Sans CJK SC Regular (Simplified
Chinese); the web build embeds only BIZ UDPGothic (about 4.5 MB of the download).
2. **System fonts** on desktop: Yu Gothic / Meiryo, Microsoft YaHei / SimSun and Malgun Gothic on
Windows; Hiragino, PingFang / STHeiti and Apple SD Gothic Neo on macOS; Noto Sans CJK, WenQuanYi,
Droid Sans Fallback and Nanum Gothic on Linux and FreeBSD.
**Web limitation:** a browser page can't read system fonts, so the web build shows CJK text only
with the fonts it embeds: Japanese (and most shared Han characters) when built with craft-fonts,
none without it. A language no available font can draw appears in the picker under its English
name and can't be selected.