mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-11 03:51:01 +00:00
1.7 KiB
1.7 KiB
Translations
The Manager interface exists in English (source), Russian, German, French and Spanish. Everything except English is a draft written by an AI assistant and needs review by a native speaker before it is treated as final.
Where the texts are
| What | File | Notes |
|---|---|---|
| Interface texts | src/i18n/locales/<lang>.ts |
flat "key": "text" lists; en.ts is the source of truth, other languages fall back to it |
| Setting titles, descriptions, categories, presets, units, option labels | src/i18n/schema/<lang>.json |
generated once from schemas/*.json; edit the JSON directly |
| Backend error messages | keys err.<code>.title / err.<code>.message in the locale files |
codes come from crates/coa-core/src/error.rs |
{name} placeholders must stay exactly as they are. Plural forms use the suffixes _one, _few, _many, _other
(the browser picks the right one for the language).
Checking your work
node tools/check-i18n.mjs # unknown keys, changed placeholders, coverage, schema overlays complete
npx tsc --noEmit # types
npx vite # UI with mock data in a browser; pick the language on the welcome screen
Adding a language
- Copy
src/i18n/locales/en.tsto<lang>.ts(keep the keys), translate, and register it insrc/i18n/index.tsx(Locale,LOCALES,DICTS). - Copy
src/i18n/schema/ru.jsonto<lang>.json, translate the values, and register it inSCHEMA. - Run the check above.
Known gaps
- Free-form technical messages produced deep inside the backend (
Error::Invalid("...")) stay in English; they are shown as "technical details". - Texts inside the game itself (client, server data) are not part of the Manager.