21 lines
2 KiB
Markdown
21 lines
2 KiB
Markdown
# Client languages
|
|
|
|
The native desktop client includes complete English and Russian interfaces. Choose **Settings → Appearance → Language** to switch immediately. **System default** follows the OS locale; unsupported languages fall back to English. Ukrainian and Polish will be added once their catalogs are complete, rather than exposing partially translated options.
|
|
|
|
The selection is local to this device, saved in the platform configuration directory at `vnox/language.json`. Existing audio, theme, profile and avatar settings are separate. Changing language retains chat drafts, edited CSS, avatar crop state and key backup inputs. It never translates messages, nicknames, channel names or external error details.
|
|
|
|
## Updating interface text
|
|
|
|
English is the canonical source language. Native Slint components use `@tr("Settings")`; use parameters for dynamic text (`@tr("Reply to {}", name)`) and Slint's plural expression for counts. Avoid concatenating translated sentence fragments. Stable protocol identifiers and internal settings keys remain untranslated.
|
|
|
|
Add the Russian translation to `translations/ru.json`, then run:
|
|
|
|
```sh
|
|
python3 scripts/update-translations.py
|
|
python3 scripts/update-translations.py --check
|
|
cargo test --bin vnox-client
|
|
```
|
|
|
|
The script generates deterministic bundled `en` and `ru` PO files, checks placeholder parity and fails on missing native or Rust translations. Slint embeds them at build time; no system gettext installation or network translation service is needed. `build.rs` disables implicit component contexts so the shared catalog has one key per app-owned English message.
|
|
|
|
Rust uses `ui::i18n::text`/`format` for immediate errors and `Message::with` for persistent statuses that must update when the locale changes. Interpolation processes only the app template once, preserving user-provided argument values exactly. Keep technical error context as arguments. New languages need complete reviewed entries, their native plural rules in the generator and a supported preference before becoming selectable.
|