Files
deckcraft/apps
352ecf87b7 i18n: interface languages from craft-i18n, English and German (#15) (#1488)
* i18n: interface languages from craft-i18n, English and German (#15)

DeckCraft reads the shared craft-i18n catalogs (roadmap step 3d there), wired as in WordCraft's
pilot: strings stay English in the code and are looked up when drawn (`tl!`); `build.rs` embeds
`locales/<lang>/common.tsv` and `deckcraft.tsv` from `CRAFT_I18N_DIR` at the commit in
`craft-i18n.rev`, and a build without it is English only.

- `language` setting in ui.json: `auto` (follow the system, `DECKCRAFT_LANGUAGE` overrides) or
  a code; Preferences › Interface language and the `app.language` UI command set it, Cancel in
  Preferences restores it. Offered: English and German.
- Translated: ribbon tabs and buttons (through the widgets), command palette (found by German
  or English name or id), status bar, File tab, dialog titles, buttons, fields and choice
  lists, panes. Command ids, tab ids, engine labels returned to scripts, the control channel,
  CLI and MCP stay English.
- Tests: lookup and fallback, setting validation, `app.language`, switching the live UI to a
  German fixture and back (tab ids stay English), Preferences Cancel, and that embedded catalogs
  parse cleanly.
- Docs: ATTRIBUTION (craft-i18n), localization-parity, gaps, ROADMAP.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* i18n: address CodeRabbit review on #1488

Translate the Photo Album accessible names and Quick Access Toolbar
labels before a shortcut is appended; align the localization estimate
and the beta scope in the docs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Format sorter.rs after the merge

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* i18n: address review on #1488

Toolbar labels saved from a two-line ribbon caption (New Slide) find
their catalog row, the toolbar's add/remove menu item is translated,
and a saved language code this build doesn't offer is kept instead of
being reset to auto, so a local build without catalogs doesn't lose a
release's choice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* i18n: pin craft-i18n at the merge of storytold/craft-i18n#71

That commit has locales/de/deckcraft.tsv, so CI and release builds with
CRAFT_I18N_REQUIRED=1 find the German catalog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* i18n: Cancel in Preferences restores a saved language this build doesn't offer

restore_preferences put the language back through app.language, which
refuses a well-formed code this build has no catalog for (one UiState
keeps, e.g. fr from a build with more languages). The refusal was
ignored, so Cancel left the language picked in the dialog. The saved
value is now written back directly, like the interface size.

Also moves the note on German to the doc comment of LANGUAGES: rustfmt
kept it on the en entry.

* i18n: the palette leaves out Interface Language; the web presenter takes the show's language

Run from the palette with {}, app.language only reported the setting, so
choosing Interface Language did nothing. The palette leaves it out; the
language is picked in Preferences…, which it lists. Scripts call it as
before.

The web presenter popup is its own program and never set a language, so
it stayed English under a German show. The snapshot now carries the
audience window's language and the popup applies it before drawing,
including its own waiting and closed messages. A snapshot from an older
build has no language and follows the system.

* i18n: a catalog craft-i18n has but LANGUAGES doesn't list is embedded, not offered

embedded_catalogs_parse_cleanly required every embedded locale to be
offered. build.rs embeds every locale with a DeckCraft catalog, so each
new catalog in craft-i18n (French is on its main already, more are open
there) would have failed the next craft-i18n.rev bump here. craft-i18n
allows an app to embed a locale it doesn't offer yet; the test now
checks that such a locale really isn't offered, and every embedded
catalog still has to parse cleanly.

* i18n: a caller's Quick Access Toolbar label stays literal

`app.qat`'s `label` is the caller's own text, so it is no longer looked up
in the catalog: a custom "Open" stays "Open" under German. Built-in and
ribbon captions are still English interface strings and follow the
language. `QatItem::literal` records which one a label is; it is saved
with the toolbar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* i18n: keep the labels of toolbars saved before QatItem::literal

A saved toolbar has no record of where a label came from, and the
missing field read as "an interface string", so a caller's custom
"Home" label for insert.table became "Start" in German after the
upgrade. `literal` is now optional: an item without it translates only
when its label is still the built-in one for its command, anything else
stays as saved.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Apply hosted formatter to QAT localization

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
Co-authored-by: Kirill M <[email protected]>
2026-12-04 10:39:19 +01:00
..