Skip to content

feat: translations for German, Spanish, French, Dutch and Portuguese - #114

Merged
tempus2016 merged 2 commits into
mainfrom
feat/translations
Nov 8, 2026
Merged

tempus2016 merged 2 commits into
mainfrom
feat/translations

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Chartdeck now speaks German, Spanish, French, Dutch and Portuguese, laid out the same way as Decluttering Card Plus.

  • Every string the card and editor show moved out of the 53 source files that registered them into src/locales/en.json (766 keys). src/locales/{de,es,fr,nl,pt}.json translate all of them.
  • English is bundled. Each other language builds to its own hashed chunk, chartdeck-card.<lang>-<hash>.js, loaded with a relative dynamic import only for people using that language. It is requested as the resource loads; until it lands the card reads English, and the card and every editor element redraw once it arrives (LanguageController). pt-BR falls back to pt, and any missing string falls back to English.
  • Editor schema caches are keyed by the language actually in use, so an English schema built before the chunk arrived is replaced afterwards.
  • Source maps now ship beside every file. scripts/clean-dist.mjs empties dist/ before each build so old hashed chunks do not linger.
  • The release attaches every dist/*.js and dist/*.js.map; provenance attestation covers every dist/*.js. HACS downloads every .js in dist/, so Marketplace installs need nothing new.
  • README, CONTRIBUTING, the PR template and the release announcement describe the multi-file manual install.
  • test/localize.test.ts checks every locale has every English key with the same placeholders, plus the loading and fallback behaviour.

Tested on the dev instance with a German profile: only the German chunk was fetched and the card showed German text.

Every string the card and editor show now lives in src/locales/en.json instead of
inline registerStrings calls. English is bundled; each other language is its own
hashed chunk (chartdeck-card.<lang>-<hash>.js) that loads only for users of that
language, and cards and editors redraw when it lands. Source maps ship beside every
file, and the release attaches all dist/*.js and dist/*.js.map.
@github-actions github-actions Bot added documentation README, wiki, or in-code documentation gauges Rings, arcs and needle gauges editor The visual editor and the card picker translations Languages other than English tests The unit suite and coverage ci Workflows, build, release plumbing labels Nov 8, 2026
@tempus2016
tempus2016 merged commit 82c1737 into main Nov 8, 2026
9 checks passed
@tempus2016
tempus2016 deleted the feat/translations branch November 8, 2026 23:12
@github-project-automation github-project-automation Bot moved this from Todo to Done in Chartdeck Planner Nov 8, 2026
github-actions Bot pushed a commit that referenced this pull request Nov 8, 2026
## [2.1.0](v2.0.0...v2.1.0) (2026-11-08)

### Features

* translations for German, Spanish, French, Dutch and Portuguese ([#114](#114)) ([82c1737](82c1737))

### Documentation

* call HACS the Home Assistant Marketplace; pin the box plot test clock ([#113](#113)) ([475eeb9](475eeb9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Workflows, build, release plumbing documentation README, wiki, or in-code documentation editor The visual editor and the card picker gauges Rings, arcs and needle gauges tests The unit suite and coverage translations Languages other than English

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant