add-language

Solid

Use when adding a new interface language (locale) to the app, or when asked to translate the UI into another language. Covers the translation file, the two language pickers, the i18n resources, and the user doc that names the available languages.

AI & Automation 38 stars 8 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 82/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Adding a new interface language The app bundles translations at build time. Adding a locale means touching five code locations plus two prose locations. Miss any one and the failure is silent: i18next falls back to English mid-screen, or the new locale ships with no key-parity coverage. Run all npm commands from `app/`. Below, `{code}` is the ISO code (`it`) and `{Name}` is the language's own name for itself (`Italiano`). ## 1. Create the translation file ```bash mkdir -p app/src/locales/{code} cp app/src/locales/en/translation.json app/src/locales/{code}/translation.json ``` ## 2. Translate the values Translate every value in `app/src/locales/{code}/translation.json`. Do not change, add, or drop keys. The key-parity test in step 5 fails if the shape drifts from `en`. Labels must fit 320px (project rule in `AGENTS.project.md`), so prefer the concise translation where two options exist. ## 3. Add the language name to every translation file The `languages` section of each locale lists all languages, so the picker reads correctly whatever language the UI is currently in. Add `"{code}": "{Name}"` to the `languages` section of every `translation.json` under `app/src/locales/`, the new one included. List them first rather than working from memory: ```bash ls app/src/locales ``` Use the same string `{Name}` in all of them. Language names are not translated. ## 4. Register the locale in i18n In `app/src/i18n.ts`, add the import alongside the others and the entry in `r...

Details

Author
ZoneMinder
Repository
ZoneMinder/zmNinjaNg
Created
8 months ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category