For translators, see the Translating section of the README. This page is for developers changing interface text.
The interface text lives in src/frontend/src/locales/, one JSON file per
language. en.json is the source: every other language is translated from it,
and any string a language has not translated yet shows in English.
Keys are nested objects grouped by component (settings → button → label)
and looked up by their dotted path, t('settings.button.label'). Don't write a
flat "settings.button.label" key: a file would end up mixing both shapes. keys.test.ts fails on dotted keys.
To change a translation, edit that language's file in a normal pull request. To add a
string, add it to en.json and to every other language file in the same pull request.
A string that depends on a number gets one key per plural form, named the i18next
v4 way: symbolCount_one and symbolCount_other inside sentence in
en.json. Render it with tPlural(key, count) from src/frontend/src/i18n.ts,
not t. The helper picks the form the active language needs, so each
language has its own plural forms, such as _few and _many for Russian.
A new JSON file alone does nothing. The app only loads the languages it lists. To
add one, open a pull request that, under src/frontend/src/:
- adds
locales/<code>.jsonas an empty{}, unless a translator already started the language and its file exists, - in
i18n.ts, imports that file, adds it to the catalogs passed tocreateI18n, and adds the code toSUPPORTED_LANGUAGES, - adds the language's own name for itself (e.g. "Deutsch") to
LANGUAGESincomponents/SettingsMenu.vue, in the same position as inSUPPORTED_LANGUAGES, and to the expected list incomponents/__tests__/SettingsMenu.test.ts, - imports the file in
locales/__tests__/keys.test.tsand adds it toCATALOGS, so its keys and placeholders are checked too.