Skip to content

feat(notifications): localise push text and action buttons (#1037) - #1041

Merged
tempus2016 merged 3 commits into
mainfrom
feat/1037-localize-push-notification-text-and-action-buttons
Oct 7, 2026
Merged

tempus2016 merged 3 commits into
mainfrom
feat/1037-localize-push-notification-text-and-action-buttons

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Fixes #1037

TaskMate's push notifications now follow Home Assistant's language (Settings → System → General), the same as the cards and panel.

What's localised

  • All 30 built-in notification messages (approvals, reminders, badges, streaks, auctions, inspections, …)
  • The approval push buttons: Approve / Reject, the reject reply box button and its "Reason (optional)" placeholder
  • The "Open the TaskMate panel to approve or reject." hint added for non-mobile backends (Telegram, email, …)
  • Sentences other coordinators build into a push: auction result (won / no bids / called off), weekly digest lines, monthly report lines

German example from the issue:

Alex hat „Spülmaschine ausräumen“ erledigt (+5 Punkte) – wartet auf Freigabe.
Buttons: Genehmigen / Ablehnen

How

  • New notify_strings.py: reads notify.* keys from www/locales/<lang>.json (exact language, then its base, so de-CH → de), off the event loop, cached per language. English is baked in, so a missing locale, missing key or broken translation still produces a readable English message.
  • A custom message_template is the user's own text and is left untouched.
  • Action ids are unchanged, so pushes already on phones keep working.
  • Translated into da, de, fr, nb, nn, pl, pt, pt-BR.

Not in this PR (follow-up)

Celebration messages, recap-ready messages, month names in the monthly report / season champion, and the auction date label are still English. They're built in several other places and feed bus events too, so they need their own change.

Tests

  • tests/test_notify_strings.py: en.json matches the baked-in English; every locale keeps exactly the English placeholders; German message + buttons end to end through fire(); base-language and English fallbacks; a broken translation falls back to English; the panel hint is translated; custom templates untouched.
  • Full suite: 3035 passed. Translation parity, data files and ruff pass.

Built-in notification messages, the Approve/Reject buttons, the reject
reason placeholder and the "open the panel" hint now follow Home
Assistant's language. Wording lives in www/locales under notify.* keys;
English is baked in as the fallback for a missing locale, key, or a
translation whose placeholders don't format.

Also localises the caller-built auction result, weekly digest and monthly
report lines. Translated into da, de, fr, nb, nn, pl, pt, pt-BR.
@github-actions github-actions Bot added backend Python integration code translations i18n / locale strings tests Test suite labels Oct 7, 2026
@tempus2016
tempus2016 merged commit a1f0ab3 into main Oct 7, 2026
16 checks passed
@tempus2016
tempus2016 deleted the feat/1037-localize-push-notification-text-and-action-buttons branch October 7, 2026 18:21
tempus2016 added a commit that referenced this pull request Oct 7, 2026
Follow-up to #1041. Celebration messages, recap announcements (and their
period labels), month and weekday names in the monthly report, season
champion and auction dates, name lists ("A, B and C") and the panel's
test-push sample names now follow HA's language too.

Strings are loaded at startup and reloaded when HA's language changes,
so text built outside the dispatcher is translated as well. A test push
now fills {date}, {max_points}, {result_text} and {freezes_left}, which
were previously sent as literal placeholders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Python integration code tests Test suite translations i18n / locale strings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Localize push notification text and action buttons

1 participant