-
Notifications
You must be signed in to change notification settings - Fork 0
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
Translation of weather strings like "Partlycloudy"? #16
Comments
Weather state strings are provided by your weather provider on Home Assistant. Check if they support changing the language or it might be coming straight from the Home Assistant configuration which might be using the English language. However, once you are able to translate the weather state strings, you might need to change the names of the weather icons as per the language of weather state strings as they are currently hard-coded in English. |
Update: You can follow this old discussion to translate weather state strings within HA and use the same in wallpanel-screensaver config,
template:
- sensor:
- name: "current_weather"
state: >
{%- set state = states('weather.home') -%}
{% if state == 'clear-night' %} Ясно, ночь
{% elif state == 'cloudy' %} Облачно
{% elif state == 'exceptional' %} Предупреждение
{% elif state == 'fog' %} Туман
{% elif state == 'hail' %} Град
{% elif state == 'lightning' %} Молния
{% elif state == 'lightning-rainy' %} Молния, дождь
{% elif state == 'partlycloudy' %} Переменная облачность
{% elif state == 'pouring' %} Ливень
{% elif state == 'rainy' %} Дождь
{% elif state == 'snowy' %} Снег
{% elif state == 'snowy-rainy' %} Снег с дождем
{% elif state == 'sunny' %} Ясно
{% elif state == 'windy' %} Ветрено
{% elif state == 'windy-variant' %} Ветрено
{% else %} Нет данных
{% endif %}
wallpanel_screensaver:
...
...
info_template: '
<div id="wallpanel-screensaver-info-weather">
<table>
<tr>
<th><img id="weather-temperature-icon" src="{{ filesParentPath }}/weather-icons/thermometer.svg"/></th>
<th>{{ states[config.weather_entity].attributes.temperature }}° </th>
<th><img id="weather-state-icon" src="{{ filesParentPath }}/weather-icons/{{ states[config.weather_entity].state }}-sun-{{ states["sun.sun"].state.replace("_", "-"); }}.svg"/></th>
<th>{{ states["sensor.current_weather"].state.replace(/(^|\s)[A-Za-zÀ-ÖØ-öø-ÿ]/g, c => c.toUpperCase()) }}</th>
</tr>
</table>
</div> The advantage of this is that you don't have to rename the English hard-coded names of weather icons in the process! |
With the weather data on my screensaver, next problem is it is in English and not in Swedish, that the date info is.
I volunteer to do the translation to Swedish of the Weather strings like "Partly cloudy", but don't know how to do it.
(I am not a developer and don't code)
/Magnus
The text was updated successfully, but these errors were encountered: