-
Notifications
You must be signed in to change notification settings - Fork 12
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
Home Assistant: Add language translation dict for states that come back from HA #275
Comments
Hello @oerkel47! I think I have a solution for the HA API returning states/attributes in English. Since it only affects the Home Assistant component, I've created an The idea being that any English response that comes back from the API indicating a state (like In all of the domain-specific controller and their language files it can be accessed with I kinda like the idea of having all the responses from the API translated in the same place. If you want to try out the branch and let me know how it goes that would be great! I tried it out a bit and I hope it'll be useful overall. |
Thanks @JarvyJ, I will try it out soon. |
Wouldn't it be a good idea to directly translate the translatable entries inside the response dict inside the base class? Would take the work from the translators while also keeping the language specific code tidy.
This works, but looks ugly. |
Oh, I like that idea! It'll make it a lot nicer for translators. I'll see if I can get it worked in today along with a workaround for #274 |
The branch has been updated! So I ended up doing the translation work in the Home Assistant api code. This way any I've also made the I'll do a bit more testing on my end, and if it seems good for you, we can merge and go from there! |
Regarding the translation: my first tests worked without issue, but have not done many. Nice work! |
closed with #279 |
Yeah, this is kinda interesting. Since it affects just Home Assistant, I think I might add a language dictionary that gets auto-loaded based on language settings and provided back in the base constructor for use. English words that need to be translated from Home Assistant could all be defined there with their translations and the code could reference. I'll create a new issue and play around with it a bit to see how it would work.
Originally posted by @JarvyJ in #232 (comment)
The text was updated successfully, but these errors were encountered: