mirror of
https://github.com/devmobasa/wayscriber.git
synced 2026-11-01 07:36:42 +01:00
docs/I18N.md still said the configurator was untranslated, that the
language was set once at startup, and that a translation could reorder
the {} placeholders; the guard rules and the steps for adding a language
were incomplete. It now covers which processes draw translated text and
when each picks up a change, the configurator preview, how auto resolves
in a systemd user service, the fixed placeholder order, the guard's call
forms and its derived-label audit, the limits on local catalog overrides,
search under translation, and every place a new language has to be added.
CONFIG.md, config.example.toml and the catalogs README state the same
timing, override and placeholder rules.
1.2 KiB
1.2 KiB
Translation catalogs
One TOML file per language, named by its code: zh-CN.toml is Simplified
Chinese. Keys are the English source strings the UI draws, values are what the
language shows instead.
"Boards" = "画板"
"Saved {} of {}" = "已保存 {} / {}"
- Only values are translated. Never change a key; it is the lookup key.
- Keep the number of
{}placeholders equal to the key's. A placeholder may move within the sentence, but values fill them in order: the first{}in the value always receives the first value, so two cannot be swapped. - An entry whose value equals its key is dead weight and fails the guard.
- The file is ordered by key, case-insensitively.
These files are checked, and missing entries are reported, by:
cargo test --test repository_guards translations
See docs/I18N.md for the whole workflow, and src/i18n.rs for how a catalog
is loaded. A copy of a catalog placed in
$XDG_DATA_HOME/wayscriber/locales/<code>.toml (or the directory
WAYSCRIBER_LOCALE_DIR names) merges over the embedded one, which is how a
translation is corrected without rebuilding. It must be a regular file of at
most 1 MiB, not a symbolic link; otherwise it is ignored and the embedded
catalog is used.