Skip to content

Add Danish translation - #912

Merged
tempus2016 merged 7 commits into
tempus2016:mainfrom
sorenkristensen80:add-danish-translation
Sep 25, 2026
Merged

tempus2016 merged 7 commits into
tempus2016:mainfrom
sorenkristensen80:add-danish-translation

Conversation

@sorenkristensen80

Copy link
Copy Markdown
Contributor

Summary

Adds a full Danish (da) translation for both catalogues:

  • custom_components/taskmate/translations/da.json (config flow, selectors, services)
  • custom_components/taskmate/www/locales/da.json (cards and admin panel)

Only values are translated — all keys, placeholders and HTML tags are unchanged. Technical values users type into services (e.g. morning, sticky, bronze) are deliberately left in English, as are Badge, Streak, Level/Lvl and XP, which is what Danish children and teens actually use.

scripts/check_translations.py passes — both catalogues match en.json key-for-key.

The translation was drafted with AI assistance and then reviewed and corrected by me as a native Danish speaker.

If da should also be added to the locale lists in CONTRIBUTING.md, the PR template or the wiki's Supported Languages table, let me know and I'll include it.

Related issue

N/A — new language, no existing issue. Motivation: Danish households using TaskMate currently fall back to English.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation only
  • CI / tooling / chore

How has this been tested?

Installed both files on my own Home Assistant instance with the user language set to Danish and restarted. The admin panel and cards show the Danish strings.

  • Ran ruff check . locally (matches the Ruff CI check)
  • Ran pytest locally (matches the Run tests CI check)
  • Exercised the change on a live Home Assistant instance
  • For card changes: hard-refreshed the browser and checked the console for errors

Checklist

  • My code follows the existing patterns in the codebase
  • I bumped manifest.json version if this is a release-bound change
  • Any new user-facing strings are translated into all locales
    (de, fr, nb, nn, pt, pt-BR) in this same PR — not English-only
  • I updated the README / docs where relevant
  • I did not add Claude / AI co-author attribution to commits or files

Screenshots / recordings

image image

Signed-off-by: sorenkristensen80 <97378805+sorenkristensen80@users.noreply.github.com>
Signed-off-by: sorenkristensen80 <97378805+sorenkristensen80@users.noreply.github.com>
@github-actions github-actions Bot added the translations i18n / locale strings label Sep 24, 2026
@tempus2016

Copy link
Copy Markdown
Owner

Thanks for this, and for doing it properly. I've been through both files and the translation itself is in good shape — key parity is exact on both catalogues, every placeholder and HTML tag matches en.json, no empty values, and the key order is line-for-line identical. I also scanned the prose for English left in by accident and found nothing. Nice work.

One thing will stop it going in, though. The checks haven't run yet (first-time contributor, so I have to approve the run manually), but when they do, Run tests is going to fail on this:

tests/test_locales_not_english_copies.py::test_no_new_untranslated_english_strings

That test exists because check_translations.py only ever compares keys, never values, so "add the key, paste the English in" used to sail through — that's how most of the activity card shipped untranslated to German and French users a while back. So there's now a second test that flags every value byte-identical to en.json, with tests/data/locale_english_baseline.json whitelisting the ones that are identical for a good reason: loanwords, units, product names. It globs the locales directory, so da.json got picked up the moment you added it, and all 36 of its English-identical values came back unlisted.

Almost all of them are exactly the coincidences you describe in the PR body, and most are already whitelisted for other languages. So the fix is to add a da.json block to that baseline file. It goes first, since da sorts before de:

  "da.json": [
    "activity.reason_bonus",
    "badge.source_auto",
    "badge.tier_bronze",
    "badges.default_title",
    "badges.label",
    "child.bonus_label",
    "child.bonus_tooltip",
    "child.extra_submit",
    "child.level_label",
    "child.pause",
    "child.start",
    "common.design.cleanpro",
    "common.design.console",
    "common.design.playroom",
    "dashboard.tab_rotation",
    "overview.default_title",
    "panel.badge_tab_title",
    "panel.badge_table_badge",
    "panel.badge_table_bonus",
    "panel.child_avatar_label",
    "panel.child_stat_level",
    "panel.chore_image_upload",
    "panel.entity_bonus",
    "panel.health_count_badges",
    "panel.nav_system",
    "panel.notif_send_test",
    "panel.reward_badge_jackpot",
    "panel.settings_surprise_chance",
    "panel.tab_badges",
    "points_card.quick_label_add",
    "points_card.quick_label_remove",
    "points_display.editor.show_streak",
    "points_display.editor.title_placeholder",
    "points_display.streak",
    "rewards.jackpot"
  ],

Two other small things while you're in there:

common.design.graphite — this is still "Graphite". Norwegian and German both translate it (Grafitt, Graphit), so I suspect this one's an oversight rather than a deliberate loanword. "Grafit"? That's why it's missing from the list above. If you'd rather keep it in English, just add the key back to the list instead.

tests/test_weekly_target_cards.py — line 57 hardcodes the locale list rather than globbing it, so "da" needs adding there too or Danish won't be covered by that check.

On Level and Lvl {level}: I've left both in the whitelist as you have them. Every other locale does translate those, but you're the native speaker and you flagged it as deliberate, so I'll take your word for it.

And yes please on the docs — that'd be a help. .github/CONTRIBUTING.md (line 30 and line 100) and .github/PULL_REQUEST_TEMPLATE.md (line 41) all list the locales and need da adding, otherwise the next person adding a string won't know Danish exists and it'll drift. Don't worry about the wiki, I'll do the Localization page when this merges.

For what it's worth, I ran the full suite against your branch locally and got 2074 passed with that one failure and nothing else, so the baseline block plus those two edits should be all it needs.

Translate Graphite to Grafit

Signed-off-by: sorenkristensen80 <97378805+sorenkristensen80@users.noreply.github.com>
Add da to weekly target locale test

Signed-off-by: sorenkristensen80 <97378805+sorenkristensen80@users.noreply.github.com>
@github-actions github-actions Bot added the tests Test suite label Sep 25, 2026
sorenkristensen80 and others added 3 commits September 25, 2026 06:25
Add da.json to English baseline

Signed-off-by: sorenkristensen80 <97378805+sorenkristensen80@users.noreply.github.com>
Add da to locale lists in CONTRIBUTING

Signed-off-by: sorenkristensen80 <97378805+sorenkristensen80@users.noreply.github.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci CI, workflows, and tooling labels Sep 25, 2026
@sorenkristensen80

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review! All done:

Added the da.json block to locale_english_baseline.json
Translated Graphite to "Grafit" (good catch, I saw it as a name/brandname for the styling and didn't even consider it)
Added "da" to the locale list in test_weekly_target_cards.py
Added da to CONTRIBUTING.md (both places) and PULL_REQUEST_TEMPLATE.md

The checks should now pass - happy to fix anything that still fails. Never tried this before, so please let me know if something's off :)

Have a nice weekend - and thank you very much for Taskmate!

// Søren

@tempus2016
tempus2016 merged commit 7b2c71b into tempus2016:main Sep 25, 2026
11 checks passed
tempus2016 added a commit that referenced this pull request Sep 25, 2026
CONTRIBUTING.md picked up Danish in #912 but the PR checklist did not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI, workflows, and tooling documentation Improvements or additions to documentation tests Test suite translations i18n / locale strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants