-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
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.
This comment was marked as resolved.
This comment was marked as resolved.
Hi @NoRi2909, I know it is not a correct german sentence, but your change would avoid all other languages just to fix 1. It is still readable and understandable for us germans and the most important thing is that the content is correct and the user knows whats going on. |
@wendevlin You are overlooking the forced lowercase which is the primary problem here. So we need to address this. If you want to keep lowercase in English then we need to add lowercase strings for that like we do in many similar strings. |
Ok sorry I just speak 2 languages, what other languages are affected? |
Judging from what I see in Lokalise Portugese also uses uppercase in all those lowercase strings. But the second part, the gender problem is affecting more or less every European language. For example in French: l' interrupteur (the switch) Here rewording as suggested with "… a 'Type' entity …" solves the gender problem, too. I see that the French strings in Lokalise will all break with female entity domains (4 out of the 6 possible ones above) as they are all hard-coded for male: Ce {domain} sera supprimé et l'interrupteur d'origine sera de nouveau visible. Vos configurations existantes utilisant le {domain} ne fonctionneront plus ! Should be "Cette …" and "la …" Ce {domain_1} sera supprimé et remplacé par un nouveau {domain_2}. Vos configurations existantes utilisant le {domain_1} ne fonctionneront plus ! Should be "Cette …" , "une nouvelle …" and "la …" And with a switch in French you have male, but need to write "l'interrupteur" not "le interrupteur", and "un nouvel interrupteur" not "un nouveau interrupteur". This is exactly the same mess as we have in German, just that we have three genders, not just two. |
I just noticed that it gets even worse in French for the "cover" type. They use "les volets" (plural) for that entity type. |
Just for the most common change from a switch to a light most languages don't work with the current wording: Dutch: "een nieuwe schakelaar" / "een nieuw licht" |
Hi 👋 French is using the form For example, for intents, we have translations inside templates to fix that issue : https://github.com/home-assistant/intents/blob/fd7a5beae192c1e346352fb290cdc441181a2456/sentences/fr/_common.yaml#L68-L84 |
We have multiple options :
|
@piitaya This is what it looks like today: And it's the same mess in every European language … So fixing it at the source in English is the best way to get this into every translation. |
Oh right, the EDIT : fixed in lokalise |
Yes, now that will work in French, too. I do have the same fixes in place in German for over two months now, but the forced lowercase is still a problem for German. As there are just seven domains possible for the entity type here you can go the route to add those in lowercase for proper English instead of forcing it in code. We could then use the correct uppercase for nouns in German for those, too. |
Hey @wendevlin that's cool! There are a few other areas where this should solve such issues. Can't wait to see that live. 👍 |
Okay. Could you do a PR with the other areas where it is needed? |
There is already one older bug #22601 about that in the Dashboard options. I'm afraid that the necessary code changes are way too complex for me to handle, especially as these settings for tap or hold actions are inherited by the different card types. So perhaps you can have a look at that one, too. We do have this every time a settings panel is referenced. In English you prefer to use sentence-casing so these name are forced to lowercase in code. We had this issue here #23372 but solved it by creating a separate lowercase string for English. If autoCaseNoun can handle this that could be fixed using this more elegant approach, too. |
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):
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:
And when you opt to change from one device type to another it gets even messier:
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:
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
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: