home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.02k stars 2.75k forks source link

Wrong use of "when" instead of the correct "if" for automation conditions #22449

Open NoRi2909 opened 1 day ago

NoRi2909 commented 1 day ago

Describe the issue you are experiencing

There are four occurrences in the Frontend strings for automations where a "when" is used and a conditional "if" should be instead:

https://github.com/home-assistant/frontend/blob/f05c204da38af322c3f7ef178ae859ec6b938bae/src/translations/en.json#L3512-L3516

https://github.com/home-assistant/frontend/blob/f05c204da38af322c3f7ef178ae859ec6b938bae/src/translations/en.json#L3192-L3195

Especially the latter three are very confusing as they are conditions, not triggers! Their description in picker even uses the correct "if".

Here the result in the UI:

Screenshot 2024-10-20 18 33 56

Describe the behavior you expected

The four "when" above should be replaced by an "if".

Noticed this while working on the German translation. The second block is likely a copy & paste error from this block:

https://github.com/home-assistant/frontend/blob/f05c204da38af322c3f7ef178ae859ec6b938bae/src/translations/en.json#L2991-L2995

Here, as a trigger, the "when" is correct.

They are fully identical in English (at the moment) but need a completely different translation in German.

What version of Home Assistant Core has the issue?

core-2024.10.3

NoRi2909 commented 1 day ago

If you can do this as one PR, here are two more:

https://github.com/home-assistant/frontend/blob/f05c204da38af322c3f7ef178ae859ec6b938bae/src/translations/en.json#L1021

https://github.com/home-assistant/frontend/blob/f05c204da38af322c3f7ef178ae859ec6b938bae/src/translations/en.json#L2163