-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Danish Translation #234
Comments
Thanks. I added that to the translations. It will be included in the next release. |
I think the Jinja2 templates do not do translations. I think it kind of makes sense. The language is set in the user properties, not system properties. And the Jinja2 template is made for automations, that work on the back end, regardless of who is currently logged in the front end, or even if nobody is logged in. And you do not want your automations to stop working when you change your language settings. Or if you have multiple users with different language settings, what would the automation do? |
Interesting. I have seen that before, and refreshing or clearing browser cache helped. |
Thanks! That worked.. |
Simple. Do something like: sensor:
- platform: template
sensors:
genbrug_verbose:
friendly_name: "Something friendly"
value_template: >-
{% if states('sensor.genbrug') == '0' %}
i dag
{% else %}
{{ states('sensor.genbrug') }}
{% endif %} I suggest testing the template in the Developer Tool / Template. Just copy and paste it there (just the value template part) and see what it does. |
Perfect! It works! Thanks man |
I do not see the picture. If you look at the entities attributes |
Should it then not be 3? |
Sorry typo. It has 3 states: 0, 1 and 2. 0 for today, 1 for tomorrow, 2 for everything else. I see that the |
So if you want your template to show this, you need to change it to: sensor:
- platform: template
sensors:
genbrug_verbose:
friendly_name: "Something friendly"
value_template: >-
{% if states('sensor.genbrug') == '0' %}
i dag
{% else %}
{{ state_attr('sensor.genbrug','days') }}
{% endif %} |
Works like a charm :) |
According to IANA, the correct language subtag for Danish is 'da'. This explains why @mpejstrup could not get the Danish translation to work in issue bruxy70#234
Hi
I also would like to contribute with a translation:
{
"state": {
"garbage_collection__schedule": {
"today": "i dag",
"tomorrow": "i morgen"
}
}
}
I have tried to fix it myself without luck. I can't get it to work. Rename the file to sensor.dk.json
Have restartet
Have done a Shift+F5
Have done a full cache refresh
The text was updated successfully, but these errors were encountered: