Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reword the three switch_as_x alerts to avoid forced lowercase #23481

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

NoRi2909
Copy link
Contributor

@NoRi2909 NoRi2909 commented Dec 27, 2024

When you change a switch entity to show up as a light, fan, lock etc. the following alert comes up as soon as you select Update (here in German):

Screenshot 2024-11-05 15 51 46

The new device type is inserted there but forced into lowercase which already causes this to be a spelling mistake in languages like German. The same happens when you revert the change, but here with two occurrences:

Screenshot 2024-11-05 15 57 22

And when you opt to change from one device type to another it gets even messier:

Screenshot 2024-11-05 16 01 52

If you know German grammar you will also have noticed that the lowercase isn't the only issue here, on top we run into a lot of grammar mistakes because it's:

  • der Lüfter (male)
  • die Leuchte (female)
  • das Schloss (neutrum)

in German, and that's getting wrong here all over the place with only one translation of "the" into German. The first screenshot already has the workaround in place suggested below, otherwise it would have the same gender problem.

Proposed change

This PR changes all occurrences of "{domain}" to "''{domain}'' entity" which makes it no longer necessary to force the entity type into lowercase for proper spelling in English.

Thus the forced lowercase is removed in code.

And with all those occurrences now becoming "… a 'Type' entity …" there is no more gender problem in all languages.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

This prepares the three switch_as_x alerts so the entity types do not need to be forced to lowercase in English as this results in broken spelling in all languages that capitalize nouns.
Removes the forced lowercase for the entity types inserted as veriables in the three alert strings.
@NoRi2909

This comment was marked as resolved.

@NoRi2909 NoRi2909 marked this pull request as ready for review December 29, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forced lowercase and grammar mess in "change device type of a switch" alerts
2 participants