Skip to content

Translating SpotNav ​

For translators and contributors: where SpotNav's texts live and how to add or improve a language.

Every text SpotNav shows lives in a JSON file per language. English is the source: every other language has exactly the English keys, with the same {placeholders}. Today SpotNav speaks English (en), Swedish (sv), Danish (da), Norwegian Bokmål (nb), Finnish (fi), German (de), Dutch (nl), French (fr) and Spanish (es).

Where the texts are ​

FolderWhat it holdsFormat
custom_components/spotnav/translations/<lang>.jsonWhat Home Assistant itself shows: setup and options dialogs, entity names and states, Repairs issues, error messages.Home Assistant's own translation format.
custom_components/spotnav/i18n/<lang>.jsonWhat SpotNav words in code: notifications, dropdown labels, the summaries in the setup dialogs, the default site name.namespace → key → text.
frontend/src/i18n/<lang>.jsonThe card.key → text, one flat object.

The card's bundle carries English only. npm run build writes every other language beside it as custom_components/spotnav/www/i18n/<lang>.<hash>.json, named by its content, and Home Assistant serves the folder at /spotnav/i18n/. The card fetches the reader's file once per page load and shows its loading state until it is in; if it cannot be had, the card is in English until the next load. The files are committed with the bundle, so an install needs no build step.

Some sentences appear in more than one place and should read the same, for example the card's state.addCharger and add_charger.hint in i18n/. Keep a language's terms the same in all three folders: the card's file is the reference for established words (charger, site, departure, charge limit and so on).

Placeholders such as {name} or {amps} are filled in by the code. Keep each one exactly, and write the sentence so it reads well whatever is filled in. Leave Markdown (**bold**, line breaks), product names and links as they are.

Adding a language ​

  1. Copy translations/en.json, i18n/en.json and frontend/src/i18n/en.json to <lang>.json in the same folders, with the language's code as Home Assistant uses it (de, nl, ...), and translate the values. Never change a key.
  2. In frontend/src/i18n/index.ts, add the code to LANGUAGES; in frontend/src/i18n/all.ts (what the tests and tools load), import the new file and add it to TRANSLATIONS; and add the code to SERVED_LANGUAGES in frontend/scripts/languages.mjs, so the build writes its file. The integration's side needs no code: it reads every file in i18n/, serves every file in www/i18n/, and Home Assistant reads every file in translations/.
  3. Run the checks:
    • pytest tests/test_translation_files.py: every file has exactly the English keys, none empty, with the same placeholders.
    • In frontend/: npm run type-check (a missing key is a compile error), npm test (extra keys, placeholders, and a file not listed in LANGUAGES), then npm run build for the card's asset and its language files, and commit both (npm run check-dist fails while either is stale).

A key missing from an i18n/ file, or from a card language file, falls back to English for that key, so a half-done language does not break anything, but the tests above fail until it is complete.

Numbers in notifications are written with a decimal comma in every language except English (notifications/messages.py); a language that needs another rule needs a line of code there. Dutch writes the euro sign before the amount (€ 4,50), the other languages after it (4,50 €). The card takes its numbers and dates from Intl, but the weekday in "Waiting for Sunday's prices" is built per language in weekdaySingular (frontend/src/format.ts, the Finnish genitive), so a new language whose sentence needs another form of the name needs a case there.

Glossaries ​

The words each language uses for SpotNav's recurring terms. Use them in all three folders and in the Android app (its strings.xml, its status line tables and its store texts), so a new text reads like the old ones and the card and the app call the same thing by the same name. This table is the single reference for both. Product names (SpotNav, Home Assistant, Easee, OCPP, Zaptec, Tibber, Octopus Energy), entity ids and the price areas' names, which come from the area list, are never translated.

EnglishGerman (de)Dutch (nl)French (fr)Spanish (es)
chargerLadestationlaadpaalbornecargador
onboard charger (car)Bordladerboordladerchargeur embarquécargador de a bordo
siteStandortlocatiesiteinstalación
departure / departure timeAbfahrt / Abfahrtszeitvertrek / vertrektijddépart / heure de départsalida / hora de salida
deadlineAbfahrtszeitdeadlineéchéancehora límite
charge limit (the car's)Ladegrenzelaadlimietlimite de chargelímite de carga
minimum charge levelMindestladestandminimaal laadniveauniveau de charge minimumnivel de carga mínimo
charge targetLadeziellaaddoelobjectif de chargeobjetivo de carga
state of charge, charge levelLadestandlaadniveauniveau de chargenivel de carga
plan / charging planPlan / Ladeplanplan / laadplanplan / plan de chargeplan / plan de carga
charging (the act), a planned chargeLaden, Ladevorgangladenchargecarga
charging periodLadezeitraumlaadperiodepériode de chargeperiodo de carga
solar surplusSolarüberschusszonne-overschotsurplus solaireexcedente solar
grid fee (grid transfer)Netzentgeltnettarieffrais de réseaupeaje de acceso
energy taxStromsteuerenergiebelastingtaxe sur l'électricitéimpuesto sobre la electricidad
VATMwSt.btwTVAIVA
spot priceSpotpreisdynamische prijsprix spotprecio spot
price areaPreiszoneprijsgebiedzone de prixzona de precio
load balancingLastmanagementload balancingéquilibrage de chargeequilibrado de carga
home battery (short: battery)Hausbatterie (Batterie)thuisbatterij (batterij)batterie domestique (batterie)batería doméstica (batería)
main fuseHauptsicherunghoofdzekeringfusible principalfusible general
safety marginSicherheitsreserveveiligheidsmargemarge de sécuritémargen de seguridad
grid meterNetzzählernetmetercompteur réseaucontador de red
energy meter, energy registerEnergiezählerenergiemetercompteur d'énergiecontador de energía
import / export (grid)Bezug / Einspeisungafname / terugleveringimport / exportimportación / exportación
vehicle / carFahrzeug / Autoautovéhicule / voiturevehículo / coche
a charge (history)Ladevorganglaadsessierechargecarga
plugged in / unpluggedangeschlossen / abgestecktaangesloten / losgekoppeldbranchée / débranchéeenchufado / desenchufado
Which car is plugged in?Welches Auto ist angeschlossen?Welke auto is aangesloten?Quelle voiture est branchée ?¿Qué coche está enchufado?
Change carAuto wechselnAndere autoChanger de voitureCambiar coche
Guest carGastautogastautovoiture invitéecoche de invitado
the car's position (identification)Positionpositiepositionposición (source: ubicación)
reference pictureReferenzbildreferentiefotoimage de référenceimagen de referencia
parking spot / Crop parking spotStellplatz / Stellplatz zuschneidenparkeerplaats / Parkeerplaats bijsnijdenplace de stationnement / Recadrer la placeplaza de aparcamiento / Recortar la plaza
notificationBenachrichtigungmeldingnotificationnotificación
start / stop / pause / resumestarten / stoppen / pausieren / fortsetzenstarten / stoppen / pauzeren / hervattendémarrer / arrêter / mettre en pause / reprendreiniciar / detener / pausar / reanudar
automatic price planning (Auto)automatische Preisplanungautomatische prijsplanningplanification automatique selon le prixplanificación automática por precio
Cheapest / Solar / HybridGünstigste / Solar / HybridGoedkoopst / Zon / HybrideMoins cher / Solaire / HybrideMás barata / Solar / Híbrida
strategyStrategiestrategiestratégieestrategia
schedule (paused / active)Zeitplanschemaprogrammationprogramación

The site is never the car's position: German and Dutch call the position Position / positie, so it does not read as Standort / locatie. French uses "charge" for charging and the plan (charge planifiée, plan de charge) and "recharge" only for a recorded charge in the history.

The app words Home Assistant's status codes with tables in HaStatusWording.kt that are copies of this card's status.*, issue.*, control.paused* and strategy.status.* texts. When one of those texts changes here, copy it into the app's table for the same language.

German uses "du", as Home Assistant's German does, Dutch "je", Spanish "tú" and French "vous". German never shortens automatic price planning to "Auto", which means car.

Sensnology AB. No accounts, no analytics, no tracking.