Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Extend support for translations #491

Merged
merged 8 commits into from
Jun 13, 2023

Conversation

astrandb
Copy link
Contributor

@astrandb astrandb commented Jun 11, 2023

Support for entity name translation is introduced.

All entity platforms are supported and there are no breaking changes.
Note that the language for entity name translation is selected globally in HA, Goto Settings->System->General and select language and restart HA. Currently only English and Swedish are supported. Other languages will default to English names. The language of sensor states are controlled by the language setting in your personal profile.

Known limitations:

  • Some of the strings in the vacuum entity dialog are handled by frontend and there is no support in HA for frontend localization from custom components.
  • Dynamic messages e.g. "Schedule, next start Fri 10:00" can not be translated until HA core supports placeholders in this context.

Further development in separate PR:s

  • Add translation of error status messages - Perhaps not necessary, can be a lot of work to maintain in all languages. One alternative is to "move" all error strings from const.py to en.json and it will be up to the translators to implement in their language when they have the energy.
  • Fix other supported language files to simplify for translators. Can wait until the first two languages are verified. @Thomas55555 - What is your native language?

All comments are welcome.

@astrandb astrandb marked this pull request as ready for review June 12, 2023 20:00
@Thomas55555
Copy link
Owner

grafik
My native language is german. But I prefer HA in english, because some translations are really not understandable.
For testing I selected Svenska as language. Opend it in a incognito browser, so it's not influenced by any cached values and i got the result above.
It seems, that the states are translated, but not the names. Have you tested it?

@Thomas55555
Copy link
Owner

Ah, I see, you edited your comment more since the draft of this review. Changed the general language. Now it works. Thx.

@astrandb
Copy link
Contributor Author

You must change global language in Settings->System->General and restart HA. Then the swedish entity names will appear.

@Thomas55555
Copy link
Owner

Thx @astrandb

@Thomas55555 Thomas55555 merged commit b0cc6e6 into Thomas55555:main Jun 13, 2023
3 checks passed
@priiduonu
Copy link
Contributor

Could it be possible to make the translation follow the user setting of the language, not the general setting?

@astrandb
Copy link
Contributor Author

astrandb commented Jun 25, 2023

Translation of entity names follow the global setting and translation of states follow the setting in the user profile. This behavior is built into Home Assistant and cannot be changed in integrations.

@priiduonu
Copy link
Contributor

Thank you @astrandb for explanation!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants