Skip to content

i18n: Czech interface language - #213

Merged
echelon merged 2 commits into
storytold:mainfrom
petrleocompel:i18n/czech
Oct 6, 2026
Merged

echelon merged 2 commits into
storytold:mainfrom
petrleocompel:i18n/czech

Conversation

@petrleocompel

Copy link
Copy Markdown

Adds Czech (Čeština, cs) as a third interface language next to English and Japanese, building on the current i18n.rs design.

What's included

  • The language itself: Language::Cs (serialised as "cs") is listed under VectorCraft ▸ Language as "Čeština" and is accepted by app.language {lang: en|ja|cs}. It is saved and restored like the other languages. tr() now picks the table per language with a match and cannot panic.
  • crates/ui-egui/src/i18n/czech.rs: 556 entries in menu order.
    • They translate every menu label (539 of 561). The 22 labels kept as they are form an explicit KEEP_AS_IS list: the product name, language names, OpenType, the built-in workspace names and the perspective-grid preset names.
    • They also translate the 17 labels that only appear after a toggle is flipped (Show/Hide Guides, Lock/Unlock Grid, Outline/Preview, Edit Contents/Edit Envelope…), so the menu stays Czech after you click one.
  • Tests:
    • Czech covers every menu label except fonts, sizes, plug-in names and KEEP_AS_IS. Toggle labels are collected by flipping each toggle on a real document.
    • Every Japanese and Czech entry is a real menu label; entries are unique; a translation ends in … exactly when the English does.
    • cs is accepted, saved and restored, and the Language menu lists every language.
    • czech_glyphs_are_available_without_system_fonts checks that the primary UI fonts (Source Sans 3, JetBrains Mono and egui's built-in fallbacks) contain áčďéěíňóřšťúůýž, their capitals and „“‚‘…–.
  • dialogs/plugin.rs: the "No filter plug-ins installed" header is now a pub const. A test running in parallel can install plug-ins and remove that header, so the label test refers to the constant to stay reliable.
  • ROADMAP.md: the interface-language line mentions Czech.

Translation notes

  • Written from the meaning of the English labels using standard Czech desktop conventions: menus are nouns (Soubor, Úpravy, Objekt, Text, Výběr, Efekt, Zobrazení, Okno, Nápověda) and commands are infinitives (Otevřít…, Uložit jako…, Seskupit, Oddělit). This is clean-room work: no other application's Czech localisation was consulted.
  • Some key terms:
    • artboard → pracovní plocha
    • Pathfinder → Operace s cestami
    • Expand → Rozložit
    • Swatches → Vzorník
    • Pattern → Vzorek
    • Blend (object) → Prolnutí
    • Blending Mode → Režim míchání
    • Envelope Distort → Deformace obálkou
    • Create Outlines → Převést na křivky
    • Image Trace → Vektorizace obrazu
  • Workspace names stay in English because the workspace switcher and saved preferences show them untranslated.
  • Not translated, as on main: generated labels ("Undo Move", "Last Effect: X") and the command palette, which doesn't call tr().

Testing

  • cargo test -p vectorcraft-ui-egui: 516 passed (7 of them i18n tests).
  • cargo fmt --all --check passes.
  • cargo clippy -p vectorcraft-ui-egui -p vectorcraft --all-targets -- -D warnings passes.
  • cargo check -p vectorcraft passes.
  • cargo xtask layers passes.
  • The wasm check was not run locally (the target isn't installed).

🤖 Generated with Claude Code

VectorCraft ▸ Language gains Čeština (`app.language {lang: "cs"}`,
persisted as "cs"). `Language::tr` now picks a table per language.

The Czech table (crates/ui-egui/src/i18n/czech.rs) translates every
menu title, submenu, item and header in the menu tree, plus the labels
toggling items switch to (Show/Hide Guides, Lock/Unlock Grid, Outline/
Preview, Edit Contents/Edit Envelope…). It was written clean-room from the
meaning of the English labels: commands in the infinitive, menus as nouns.
Left as-is on purpose: the product name, language names, OpenType, the
built-in workspace names and the perspective grid preset names.

Tests:
- every Czech (and Japanese) entry is a menu label, toggled labels included;
- Czech covers every menu label except fonts, sizes, plug-in names and
  an explicit KEEP_AS_IS list;
- ellipses match their source label, entries are unique;
- the Language menu lists every language; `cs` validates and persists;
- each UI font family's own first font has the Czech letters and
  punctuation (no system fonts needed).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…orytold#209): one ROADMAP line for Japanese, Czech and vertical type

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon
echelon merged commit 571881a into storytold:main Oct 6, 2026
@echelon

echelon commented Oct 6, 2026

Copy link
Copy Markdown
Member

Děkujeme, @petrleocompel, merged! A complete Czech interface (539 of 561 menu labels, plus the labels that only show after a toggle is flipped) is great, and the tests are excellent: coverage of every menu label with an explicit KEEP_AS_IS list, the ellipsis check, real menu labels only, and glyph coverage in the bundled UI fonts. I merged main into your branch after the vertical-type PRs landed (one ROADMAP line now covers Japanese, Czech and vertical type, and notes that Japanese glyphs come from craft-fonts). Full CI passes.

Heads-up: #205 proposes a TSV-catalog i18n framework. If it lands, Czech would move into it (we've asked that PR to carry your table over).

If you're not already there, come say hi in our Discord, we'd love to have you: https://discord.gg/artcraft

bflatastic pushed a commit to WildfootW/vectorcraft that referenced this pull request Oct 7, 2026
…atalog

Strings in code stay English and are the lookup keys; `crates/ui-egui/src/i18n`
maps them to display text at render time from one `*.tsv` catalog per language
(`LANGUAGES` registry, `tl!`/`t`/`tr`/`tr_ctx`/`tr_id`/`tn`/`fmt`). Command ids,
menu paths, `ui.menu.list`, the control channel, the CLI, MCP, status messages
and undo labels never see translated text, so agents, scripts and the existing
tests are unaffected (under `cargo test` the UI is always English).

Wired: in-window menus and the macOS native menu (rebuilt on a language change),
dynamic labels (Undo X, Reset X, Last Effect: X as templates), the command
palette (matches English and translated text), dock tabs, panel tooltips, the
toolbar (category names now cut by characters, not bytes), the dialog frame, the
shared widgets, the Preferences dialog, the shortcut editor, the hint and status
bars, the Home screen, and the literals of every panel and dialog.

Preference `interfaceLanguage` (User Interface › Language): `auto` or a code.
`auto` follows `VECTORCRAFT_LOCALE`, `LC_ALL`/`LC_MESSAGES`/`LANG`/`LANGUAGE`,
the macOS preferred languages and, on Windows (which sets no `LANG`), the user
locale from `HKCU\Control Panel\International`. `zh-TW`/`zh-HK`/`zh-MO`/
`zh-Hant-*` resolve to `zh-hant`; Simplified locales stay English until a
`zh-hans` catalog exists.

`zh-hant.tsv` (~2,850 rows) is clean-room, in the vocabulary used in Taiwan;
terms shared with PhotoCraft reuse its wording, vector terms use everyday
vector-drawing vocabulary. Tests: catalog well-formedness (placeholders,
ellipses, command ids, no Simplified characters), locale resolution, and two
coverage tests that fail when a menu string, panel/tool/preference label,
dialog button, hint-bar fragment or `tl!` literal has no row in a language
marked `complete_menus`. `VECTORCRAFT_I18N_DUMP=file cargo test -p
vectorcraft-ui-egui dump_source_strings` lists the strings for translators.

Also: two clippy findings under rustc 1.97 fixed in passing.

Integrated with main (squashed onto it, 42 commits on): the Czech interface
(storytold#213) moves from its Rust table to `i18n/cs.tsv` on the registry (all 556
rows, Czech plural rule, its menu-coverage and glyph tests kept); Find Font's
resolution notes and the canvas context menu's labels are translated and
covered by the catalog tests (`menus::CONTEXT_LABELS`); the glyph test checks
CJK text only when the craft-fonts build input is embedded (storytold#220 moved the
Japanese fonts out of this repository); a language saved by an older version
carries over to `interfaceLanguage`; Windows' locale lookup runs reg.exe by its
full path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants