Closed Ecoplay600 closed 3 years ago
The language used by default is the browser's language. You may override this by hass_lang_priority. This will display the card in the language set in HASS (if translation is available).
As I see the language is not hungarian like you said, but In my HA language is Hungary, where can I put hass_lang_priority ? to config.yaml ?
You'll have to use hass_lang_priority in the card configuration if you want to have the language set in Home Assistant to take priority over browser's language.
But if I add this to my card config then the language, like the rubbis take out "tomorrow" is not changed to "holnap"
You might need to clear the browser cache and reload the page.
Any update on this issue?
The problem not solved. I don't even know why, but you're addon is still english, and not Hungary. I do anytink from you're instructions.
Please let me know the language your browser is set to. In Chrome you can find this at: Settings->Advanvced->Languages. Which one is the first in the list?
Please also provide the card's full configuration.
My browser language is Hungary
- type: entities
entities:
- entity: sensor.fekete_kuka
- entity: sensor.sarga_kuka
title: Kuka szállítás
I delete the card, now i use this, can i translate it to hungary?
Please note that you are using default entities card from Lovelace, not the custom garbage collection card.
Once the card is installed and added to the resources, the custom garbage collection card definition could be something like:
- type: custom:garbage-collection-card
entity: sensor.fekete_kuka
icon_size: 35px
icon_color: green
hide_date: true
Please note that the custom garbage collection card does not support multiple sensors yet, so if you have two sensors (fekete_kuka, sarga_kuka) you should have two card definitions, one for each sensor.
okay, and where can I add the hass_lang_priority ?
You could extend the the above card definition with the extra hass_lang_priority, like:
- type: custom:garbage-collection-card
entity: sensor.fekete_kuka
icon_size: 35px
icon_color: green
hide_date: true
hass_lang_priority: true
It's not working, it still said tomorrow
Code: type: 'custom:garbage-collection-card' entity: sensor.sarga_kuka icon_size: 35px icon_color: green hide_date: true hass_lang_priority: true
Config:
It's because you are using verbose_state: true for the sensor. Of course if you set verbose_state to false you will loose the string provided by verbose_format. In exchange you'll let the card to format the displayed string and you can control it at the card. Now it's controlled at the sensor.
The sensor doesn't have Hungarian translation as per [1]
hmm, it's strange as i remember I had before.
What if I change maybe the DE translate? how can I use the DE config?
I changed config on sensorEN.json but it's not changed in main page
The custom card will bypass the string part if verbose_state is true.
Try to set Lovelace language to German. The sensor's Readme doesn't details the translation part.
For your last note: you'll have to restart HASS.
You may also create a sensorHU.json based on sensorEN.json.
I always restart HASS when I change somethink in config, but nothink happened :/
The garbage collection sensor's translation should be (if you modify the English related file (sensor.en.json)):
{
"state": {
"garbage_collection__schedule": {
"today": "Ma",
"tomorrow": "Holnap"
}
}
}
I change it to this, and nothink happened, just noting see under the title
It was the ${HASS_CONF}/custom_components/garbage_collection/translations/sensor.en.json, right? And you restarted HASS afterward?
Yes
Can you copy here the content of sensor.en.json?
{ "state": { "garbage_collection__schedule": { "today": "Ma", "tomorrow": "Holnap" } } }
And HASS is set to English, right?
no it's hungary then I need to create sensor.hu.json? to make it work?
yes
still not working
It's named sensor.hu.json, located in ${HASS_CONF}/custom_components/garbage_collection/translations/sensor.en.json, HASS restarted afterwards? HASS running in Hungarian? That should work. You may try setting the browser to Hungarian as described earlier above.
very strange what this, it's okay for me, but very strange
that's okay for me
try to clear the browser's cache and reload the page.
Working, thank you :D
Great.
where can i change language?