Decluttering Card Plus Contents ↓ GitHub ↗

Translations (v1.2.0+)

Everything the card says follows the language set in your Home Assistant profile — the editors, the error messages, the Share and Where-used tools, even the warnings it writes to the browser console. There is nothing to configure on the card itself.

Four languages ship with it:

Language File
English en.json (the source)
French fr.json
Portuguese pt.json
Spanish es.json

A regional language falls back to its base — pt-BR reads pt — and anything a translation does not cover falls back to English, key by key. So a partial translation shows a mixed card rather than a broken one.

To change language, open your profile in Home Assistant (your name at the bottom of the sidebar) and pick one under Language. The card follows along after a reload.


Adding a language

One file, no code to speak of. The translations live in src/locales/ in the main repository:

  1. Copy en.json to <code>.jsonde.json for German, it.json for Italian. The two-letter code is the one Home Assistant uses for the language.
  2. Translate the values. The keys stay exactly as they are.
  3. Register the file in src/localize.ts: one import line at the top, one entry in the LANGUAGES map. The two lines already there for fr show the shape.

What to leave alone

Some things in the sentences belong to the card, not the language:

npm test checks all of this for you: it lists any keys you have missed and fails if a translation lost one of its placeholders. Don’t agonise over a sentence you are not sure of — at runtime a missing key just falls back to English, so leave it out and say so in the pull request.

Sending it in

However you like:

Corrections to an existing translation are just as welcome, and smaller still — a pull request touching the one file, or an issue quoting the key and what it should say. If you only fix three sentences, that is three sentences better than before.