Adding a language
The texts are in JSON files: src/localize/languages/<code>.json for the card (menus, loading screen, errors) and src/localize/editor/<code>.json for the editor (labels, help texts, menus, headings), loaded only with the editor. A text missing in a language is the English one.
- Copy the two
en.jsonfiles to<code>.json(the code Home Assistant uses:fr,es,pt-BR…) and translate the texts, leaving the{name}placeholders as they are. - Add the file to
languagesinsrc/localize/localize.tsand insrc/localize/editor.ts, and the code to thelanguagemenu insrc/editor-schema.ts(with its name underoptions.languagein the editor files). - Add the code to the lists of languages in
test/i18n.test.mjs:npm testchecks that every key exists in English and that the placeholders match.
A pull request with a new language is welcome.