Replies: 2 comments
-
Unfortunately I don't think this is possible. You would need to find a translation tool that offers an API that can be used with Home Assistant, and then you would probably need to create your own custom integration that talks to that API and translates things for you. You might be able to do something with this: |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think I found a solution with the MeteoAlarm integration. It’s a sensor and the results are all in English. I just need to format the sensor data and display in a markdown card. Thanks for your input. You have a nice product. On May 17, 2024, at 6:00 PM, jaydeethree ***@***.***> wrote:
Is there a way to translate this into English using i18next JSON tool you referenced?
Unfortunately I don't think this is possible. You would need to find a translation tool that offers an API that can be used with Home Assistant, and then you would probably need to create your own custom integration that talks to that API and translates things for you. You might be able to do something with this:
https://github.com/LibreTranslate/LibreTranslate
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello - I am using a built in HA integration "Deutscher Wetterdienst (DWD) Weather Warnings" but all the warnings are in German. I have a card that gets the information and displays it. Is there a way to translate this into English using i18next JSON tool you referenced?
Below is my card. Does anyone know how to do the automatic translation?
type: conditional
conditions:
entity: sensor.dwd_weather_warnings_807335038_current_warning_level
state_not: '0'
entity: sensor.dwd_weather_warnings_807335038_advance_warning_level
state_not: '0'
card:
type: markdown
content: >-
{% set level_colors = ["#c5e566", "#ffeb3b", "#fb8c00", "#e53935",
"#880e4f"] %} {% set current_count =
state_attr("sensor.dwd_weather_warnings_807335038_current_warning_level",
"warning_count") %} {% set advance_count =
state_attr("sensor.dwd_weather_warnings_807335038_advance_warning_level",
"warning_count") %} {% if ((current_count == 0) and (advance_count == 0)) %}
<font color={{ level_colors[0] }}>Keine Warnungen {% else %}
{% for i in range(current_count) %}
{% set headline = state_attr("sensor.dwd_weather_warnings_807335038_current_warning_level", "warning_" ~ loop.index ~ "headline") %}
{% set description = state_attr("sensor.dwd_weather_warnings_807335038_current_warning_level", "warning" ~ loop.index ~ "description") %}
{% set level = state_attr("sensor.dwd_weather_warnings_807335038_current_warning_level", "warning" ~ loop.index ~ "level") %}
{% set time_start = state_attr("sensor.dwd_weather_warnings_807335038_current_warning_level", "warning" ~ loop.index ~ "start") %}
{% set time_end = state_attr("sensor.dwd_weather_warnings_807335038_current_warning_level", "warning" ~ loop.index ~ "end") %}
<font color={{ level_colors[level] }}>{{ headline }}
{{ time_start.strftime("%a %H:%M") ~ " - " ~ time_end.strftime("%a %H:%M") }}
{{ description }}
{% if not loop.last %}{% endif %}
{% endfor %}
{% if ((current_count != 0) and (advance_count != 0)) %}{% endif %}
{% for i in range(advance_count) %}
{% set headline = state_attr("sensor.dwd_weather_warnings_807335038_advance_warning_level", "warning" ~ loop.index ~ "headline") %}
{% set description = state_attr("sensor.dwd_weather_warnings_807335038_advance_warning_level", "warning" ~ loop.index ~ "description") %}
{% set level = state_attr("sensor.dwd_weather_warnings_807335038_advance_warning_level", "warning" ~ loop.index ~ "level") %}
{% set time_start = state_attr("sensor.dwd_weather_warnings_807335038_advance_warning_level", "warning" ~ loop.index ~ "start") %}
{% set time_end = state_attr("sensor.dwd_weather_warnings_807335038_advance_warning_level", "warning" ~ loop.index ~ "_end") %}
<font color={{ level_colors[level] }}>{{ headline }}
{{ time_start.strftime("%a %H:%M") ~ " - " ~ time_end.strftime("%a %H:%M") }}
{{ description }}
{% if not loop.last %}***{% endif %}
{% endfor %}
{% endif %}
title: 'Weather Alert! '
Beta Was this translation helpful? Give feedback.
All reactions