Add test ensuring identical translation keys share fallback names #3702
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
This PR adds a test ensuring that if multiple entity metadata entries share the same translation key (e.g.
child_lock
), that their fallback names also all match (e.g. "Child lock").So, one quirk can't have "Children lock" and the other "Child lock" as a fallback name if they share the same translation key of
child_lock
.Additional information
This is needed as Home Assistant has a
strings.json
file that maps translation keys to friendly names.This file is updated when bumping ZHA in HA. New translation keys are added by a script and their friendly name will, by default, be their fallback name.
If there were multiple different values per translation key, it would be somewhat "random" which value/name ends up in the
strings.json
file.We just enforce what HA requires: no more than one friendly name per translation key. Currently, everything already passes.
(cc @prairiesnpr)
Checklist
pre-commit
checks pass / the code has been formatted using Black