mirror of
https://github.com/devmobasa/wayscriber.git
synced 2026-11-01 07:36:42 +01:00
Put the language picker first in General UI, with a globe and a title that includes every supported language. Derive its title and search terms from shared language metadata. Add regression coverage for the title, icon and row order, and format the additions with the pinned Rust toolchain.
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.