-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
"detected" and "cleared" log entries need per device type variants #22247
Comments
We sort of have this already, but only for some device classes, and which ones are individually translatable are fixed in code, e.g.
But many device classes are just yoked together with the same fixed translation.
I think we could probably move this logic into the localization file itself, and just give each device_class its own key, but by default link all the existing ones back to the main translation key. Then I believe individual translators can break that link as desired for their language to give a custom string? e.g.
I think that works in Lokalise, but would be good to get a confirmation. |
@karwosts Yes, that's seems to be how it's already done for the "off" and "on" status in HA Core. I found this out using this search: Here
are the ones with a static "Clear" or "Detected" in the English language. For an occupancy sensor I changed that pair in German to "Frei" and "Belegt" which work much better. |
Checklist
Describe the issue you are experiencing
Currently there is just a single string for both the "detected" and "cleared" log entries under
So for an occupancy sensor the log entry looks like this:
In many languages there is no single translation that fits all device classes, so especially the "Cleared" log entries look really strange. In German "cleared" is currently translated as "zurückgesetzt" ("reset") which makes this even worse.
Also note that due to grammar issues we need to use "kein(e)" to translate the simple "no" in English. So to really fix this for all device classes we do need separate strings.
Describe the behavior you expected
For the state shown in the dashboard this is already solved as there are different strings defined, so the "off" state can have a proper translation.
Many can have identical translations following:
So by defaut all other were dirived from the above, which works OK for similar sensors like:
But for other this needs to be adapted, for example:
So we need a similar approach for the log entries, differentiating the "off" state.
A possible simpler approach would be to use the "on" and "off" states already defined above to create the log entries:
Steps to reproduce the issue
Just look through the different UI languages for such occupancy sensor logs, e.g.
What version of Home Assistant Core has the issue?
core-2024.10.0
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
n/a
Which operating system are you using to run this browser?
n/a
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
Note that the Swedish lokalizer already left a similar comment that he's running into that problem, too.
https://app.lokalise.com/project/3420425759f6d6d241f598.13594006/?k=58795583
The text was updated successfully, but these errors were encountered: