Closed CM000n closed 2 years ago
Hi @stokkie90, I think this is the way we have to go? https://developers.home-assistant.io/docs/internationalization/custom_integration
So far I know this only works for the python part of the integration. Like the integration configuration page. Maybe we could incorporate it in. But we might need to move towards jinja2 templating. Not sure if that is something we want. I think dwains dashboard work like that.
You are right.
It seems like he is just declaring an empty dict at first. https://github.com/dwainscheeren/dwains-lovelace-dashboard/blob/8545b42ebbc930789d917f4bf73559afd5c993f5/custom_components/dwains_dashboard/process_yaml.py#L27
then he loads the yaml with the actual translations an ataching that to the _dd_trans
variable inside the load_yaml
function:
After that he can simply use the jinja template in a form like title: {{ _dd_trans.home.title }}
in his restlicheCard templates
The way Dwains is working is already somewhat implemented.
https://github.com/stokkie90/UI/blob/main/custom_components/lovelace_minimalist_ui/process_yaml.py#L50 https://github.com/stokkie90/UI/blob/main/custom_components/lovelace_minimalist_ui/process_yaml.py#L176
closed with #756
fI think we need to align on a moment when we want to move towards hacs support. First we need some documentation around it, a logo, and figure out languages.
We can do some advanced stiff with Jinja if we want to do so.