Skip to content

fix(i18n): localize Child Badges sensor unit_of_measurement#349

Merged
tempus2016 merged 1 commit into
mainfrom
fix/i18n-child-badges-unit
May 10, 2026
Merged

fix(i18n): localize Child Badges sensor unit_of_measurement#349
tempus2016 merged 1 commit into
mainfrom
fix/i18n-child-badges-unit

Conversation

@tempus2016

Copy link
Copy Markdown
Owner

Summary

Follow-up to #347. Same anti-pattern: ChildBadgesSensor.native_unit_of_measurement was hardcoded to "badges". Replaced with _attr_translation_key = "child_badges" and entity translations in all 8 locale files.

Translations

Locale Unit
en, en-GB, fr badges
de Abzeichen
nb merker
nn merke
pt, pt-BR medalhas

Test plan

  • Set HA system language to German → reload TaskMate config entry → sensor.taskmate_<child>_badges shows Abzeichen as unit_of_measurement.
  • Switch to Portuguese → medalhas.
  • Switch back to English → badges.
  • Lint workflow passes.

Related: #348 (broader entity-name localization tracker).

Same anti-pattern as #346: ChildBadgesSensor.native_unit_of_measurement
was hardcoded to "badges". Move it to per-language entity translations.

- Add `_attr_translation_key = "child_badges"` and drop the hardcoded
  `native_unit_of_measurement` property.
- Add `entity.sensor.child_badges.unit_of_measurement` to all 8 locale
  files (en, en-GB, de, fr, nb, nn, pt, pt-BR).
@tempus2016 tempus2016 merged commit 463d3c0 into main May 10, 2026
2 checks passed
@tempus2016 tempus2016 deleted the fix/i18n-child-badges-unit branch May 10, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant