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

Entity friendly names not translated #2187

Closed
6 tasks done
terba opened this issue Oct 4, 2024 · 7 comments
Closed
6 tasks done

Entity friendly names not translated #2187

terba opened this issue Oct 4, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@terba
Copy link

terba commented Oct 4, 2024

System Health details

.

Checklist

  • I have added battery_notes: to my configuration.yaml and restarted.
  • I have read the FAQ's.
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The generated entities doesn't get their names from the translation files. For example the friendly name of "My best sensor Battery+" should be "My best sensor Elem+" with the Hungarian translation. Maybe a space is missing before the Battery+ and Elem+ strings here:
kép

Reproduction steps

...

Debug logs

No response

Diagnostics dump

No response

@andrew-codechimp
Copy link
Owner

andrew-codechimp commented Oct 4, 2024

Hi, the lack of a space is intentional as in certain circumstances there's no device name prefix.
Is this only happening with battery+ or other battery notes entities?
Can you clear your browser cache, I've sometimes seen issues with translation strings being cached.

@terba
Copy link
Author

terba commented Oct 4, 2024

Hi, this is happening with all the entities created by the integration. The attribute names are ok.
Cleared the cache, even recreated an association, but the strings are untranslated.
kép

@terba
Copy link
Author

terba commented Oct 4, 2024

Every other translated text is okay, only the friendly names not:
kép

@andrew-codechimp
Copy link
Owner

Thanks for checking the cache and providing those details, I'll have a look into it.

@andrew-codechimp andrew-codechimp added the bug Something isn't working label Oct 4, 2024
@andrew-codechimp
Copy link
Owner

Using the Sun integration as a test I changed my user and system language from English to Hungarian and the friendly names were still English.
I then deleted the Battery Note for the Sun, re-added whilst I was set to Hungarian and it added them correctly translated as can be seen below.
Can you have a look if this fixes it for you? I know there is some confusion about what translation is used if your user and system language are different, maybe you had one set to English when creating the battery notes for your device?

Apologies I am only an English speaker so localisation is tricky for me to test.

CleanShot 2024-10-04 at 11 07 20

CleanShot 2024-10-04 at 11 14 19

@terba
Copy link
Author

terba commented Oct 4, 2024

That was it, thanks! The system language was not set (defaulted to English), and the user profile language was not used for the entity names but all the others. I set the system language in configuration.yaml to Hungarian, and it works.

@andrew-codechimp
Copy link
Owner

Thanks for confirming.
I did some reading up and this is a common issue with home assistant and not just battery notes, not a great user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants