build(i18n): embed the craft-i18n catalogs pinned in craft-i18n.rev

Adds the craft-i18n crate (craft-libs f7cc8a7, storytold/craft-libs#247)
and the build.rs recipe from craft-i18n's docs/integration.md: with
CRAFT_I18N_DIR set, CRAFT_I18N embeds each locale's common.tsv and
wordcraft.tsv (paths via {:?}, never canonicalized); unset, it is empty
and the build is English only; CRAFT_I18N_REQUIRED=1 makes that an
error. craft-i18n.rev pins storytold/craft-i18n be1f053 (LF via
.gitattributes); the flatpak manifest checks out the same commit and
sets CRAFT_I18N_DIR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Martin Ball
2026-10-23 22:20:55 +01:00
co-authored by Claude Opus 5.5
parent 806a945d85
commit e649cd09da
6 changed files with 136 additions and 1 deletions
@@ -43,6 +43,9 @@ modules:
env:
CARGO_HOME: /run/build/wordcraft/cargo
CARGO_NET_OFFLINE: 'true'
# The interface translations (the craft-i18n source below), embedded by build.rs.
CRAFT_I18N_DIR: /run/build/wordcraft/craft-i18n
CRAFT_I18N_REQUIRED: '1'
build-commands:
- cargo --offline build --release --locked -p wordcraft -p wordcraft-cli
- install -Dm755 target/release/wordcraft /app/bin/wordcraft
@@ -64,4 +67,9 @@ modules:
- corpus
- build-flatpak
- .flatpak-builder
# The interface translations at the commit in craft-i18n.rev (a test keeps the two equal).
- type: git
url: https://github.com/storytold/craft-i18n
commit: be1f0535afbae9bfa1554b9afd545690eb2de2a5
dest: craft-i18n
- cargo-sources.json