Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type: custom:dynamic-weather-card
entity: weather.home
name: My Weather Station
height: 300
language: auto # auto, en, ru, de, fr, nl, es, it, hu, sk
language: auto # auto, en, ru, de, fr, nl, es, it, hu, sk, pt
overlay_opacity: 0.15 # 0-1 (dark overlay for better readability)
wind_speed_unit: ms # ms or kmh (for legacy integrations)

Expand Down Expand Up @@ -176,7 +176,7 @@ clock_format: 24h # 12h or 24h
| **Display** |
| `name` | string | - | Custom card title (leave empty to hide) |
| `height` | number | `200` | Card height in pixels |
| `language` | string | `auto` | `auto`, `en`, `ru`, `de`, `fr`, `nl`, `es`, `it`, `hu`, `sk` |
| `language` | string | `auto` | `auto`, `en`, `ru`, `de`, `fr`, `nl`, `es`, `it`, `hu`, `sk`, `pt` |
| `overlay_opacity` | number | `0.1` | Dark overlay opacity (0-1) for text readability |
| **Temperature** |
| `show_feels_like` | boolean | `true` | Display "feels like" temperature |
Expand Down Expand Up @@ -253,6 +253,7 @@ The card automatically detects your Home Assistant language or you can set it ma
| Italiano | `it` | ✅ Complete |
| Magyar | `hu` | ✅ Complete |
| Slovenčina | `sk` | ✅ Complete |
| Português | `pt` | ✅ Complete |

Want to add or improve a translation? Contribute via **[Weblate](https://hosted.weblate.org/engage/dynamic-weaher-card/)** — no coding required!

Expand Down
3 changes: 2 additions & 1 deletion src/components/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export class DynamicWeatherCardEditor extends LitElement {
{ label: i18n.t('editor.language_es'), value: 'es' },
{ label: i18n.t('editor.language_it'), value: 'it' },
{ label: i18n.t('editor.language_sk'), value: 'sk' },
{ label: i18n.t('editor.language_hu'), value: 'hu' }
{ label: i18n.t('editor.language_hu'), value: 'hu' },
{ label: i18n.t('editor.language_pt'), value: 'pt' }
]
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/internationalization/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import es from './locales/es/translation.json';
import it from './locales/it/translation.json';
import sk from './locales/sk/translation.json';
import hu from './locales/hu/translation.json';
import pt from './locales/pt/translation.json';
import type { Translation, SupportedLanguage } from './types';

const translations: Record<SupportedLanguage, Translation> = {
Expand All @@ -18,7 +19,8 @@ const translations: Record<SupportedLanguage, Translation> = {
es,
it,
sk,
hu
hu,
pt
};

class I18n {
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Italienisch",
"language_sk": "Slowakisch",
"language_hu": "Ungarisch",
"language_pt": "Portugiesisch",
"wind_speed_unit": "Einheit der Windgeschwindigkeit",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Italian",
"language_sk": "Slovak",
"language_hu": "Hungarian",
"language_pt": "Portuguese",
"wind_speed_unit": "Wind Speed Unit",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Italiano",
"language_sk": "Eslovaco",
"language_hu": "Húngaro",
"language_pt": "Portugués",
"wind_speed_unit": "Unidad de velocidad del viento",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Italien",
"language_sk": "Slovaque",
"language_hu": "Hongrois",
"language_pt": "Portugais",
"wind_speed_unit": "Unité de vitesse du vent",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/hu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Olasz",
"language_hu": "Magyar",
"language_sk": "Szlovák",
"language_pt": "Portugál",
"wind_speed_unit": "Szélsebesség egység",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Italiano",
"language_sk": "Slovacco",
"language_hu": "Ungherese",
"language_pt": "Portoghese",
"wind_speed_unit": "Unità velocità del vento",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Italiaans",
"language_sk": "Slowaaks",
"language_hu": "Hongaars",
"language_pt": "Portugees",
"wind_speed_unit": "Windsnelheidseenheid",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/u"
Expand Down
157 changes: 157 additions & 0 deletions src/internationalization/locales/pt/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"sunny": "Ensolarado",
"clear": "Limpo",
"overcast": "Encoberto",
"cloudy": "Nublado",
"partlycloudy": "Parcialmente nublado",
"rainy": "Chuvoso",
"rain": "Chuva",
"snowy": "Neve",
"snow": "Neve",
"foggy": "Nevoeiro",
"fog": "Nevoeiro",
"lightning": "Relâmpagos",
"lightning-rainy": "Trovoada",
"pouring": "Chuva forte",
"snowy-rainy": "Chuva com neve",
"hail": "Granizo",
"clear-night": "Noite limpa",
"feels_like": "Sensação",
"forecast_title": "Previsão de hoje",
"daily_forecast_title": "Previsão diária",
"no_data": "Sem dados",
"forecast_unavailable": "Previsão indisponível",
"weather": "Clima",
"language": "Idioma",
"wind_unit_kmh": "km/h",
"wind_unit_ms": "m/s",
"wind_unit_mph": "mph",
"wind_unit_knots": "nós",
"wind_unit_fts": "ft/s",
"show_clock": "Mostrar hora atual",
"am": "AM",
"pm": "PM",
"editor": {
"entity": "Entidade de clima",
"name": "Título do card",
"height": "Altura do card",
"show_feels_like": "Mostrar sensação térmica",
"show_wind": "Mostrar velocidade do vento",
"show_wind_gust": "Mostrar rajada de vento",
"show_wind_direction": "Mostrar direção do vento",
"show_humidity": "Mostrar humidade",
"show_min_temp": "Mostrar temperatura mínima",
"show_hourly_forecast": "Mostrar previsão horária",
"hourly_forecast_hours": "Horas da previsão horária",
"show_daily_forecast": "Mostrar previsão diária",
"daily_forecast_days": "Dias da previsão diária",
"show_sunrise_sunset": "Mostrar nascer/pôr do sol",
"sunrise_entity": "Entidade de nascer do sol",
"sunset_entity": "Entidade de pôr do sol",
"show_clock": "Mostrar relógio",
"clock_position": "Posição do relógio",
"clock_position_top": "Topo",
"clock_position_details": "Detalhes",
"clock_format": "Formato do relógio",
"clock_format_12h": "12 horas (AM/PM)",
"clock_format_24h": "24 horas",
"overlay_opacity": "Opacidade do overlay",
"language": "Idioma",
"language_auto": "Automático",
"language_en": "Inglês",
"language_ru": "Russo",
"language_de": "Alemão",
"language_nl": "Holandês",
"language_fr": "Francês",
"language_es": "Espanhol",
"language_it": "Italiano",
"language_sk": "Eslovaco",
"language_hu": "Húngaro",
"language_pt": "Português",
"wind_speed_unit": "Unidade de velocidade do vento",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
},
"demo": {
"pageTitle": "Dynamic Weather Card",
"pageSubtitle": "Demonstração interativa e ferramenta de configuração",
"livePreview": "Pré-visualização ao vivo",
"configuration": "Configuração",
"quickPresets": "Predefinições rápidas",
"sunnyDay": "Dia ensolarado",
"rainy": "Chuvoso",
"snowy": "Com neve",
"clearNight": "Noite limpa",
"weatherCondition": "Condição climática",
"condition": "Condição",
"temperature": "Temperatura",
"humidity": "Humidade (%)",
"windSpeed": "Velocidade do vento",
"timeOfDay": "Hora do dia",
"timeMode": "Modo de tempo",
"autoTime": "Automático (hora atual)",
"manualControl": "Controle manual",
"sunrise": "Nascer do sol",
"day": "Dia",
"sunset": "Pôr do sol",
"night": "Noite",
"currentTime": "Hora atual",
"displayOptions": "Opções de exibição",
"cardName": "Nome do card",
"height": "Altura (px)",
"feelsLike": "Sensação térmica",
"minTemp": "Temperatura mínima",
"windDirection": "Direção do vento",
"windGust": "Rajada de vento",
"hourlyForecast": "Previsão horária",
"dailyForecast": "Previsão diária",
"sunriseSunset": "Nascer/pôr do sol",
"showClock": "Relógio",
"clockPosition": "Posição do relógio",
"clockPositionTop": "Canto superior direito",
"clockPositionDetails": "Linha de detalhes",
"clockFormat": "Formato do relógio",
"clockFormat12h": "12 horas (AM/PM)",
"clockFormat24h": "24 horas",
"overlayOpacity": "Opacidade do overlay (0-1)",
"windSpeedUnit": "Unidade de velocidade do vento",
"dailyForecastDays": "Dias da previsão diária",
"hourlyForecastHours": "Horas da previsão horária",
"updateCard": "Atualizar card",
"startDemo": "Iniciar modo demo",
"stopDemo": "Parar demo",
"madeWith": "Feito com amor para o Home Assistant",
"loading": "A carregar card...",
"errorTitle": "Falha ao carregar o card",
"errorDetails": "Verifique o console do navegador (F12) para detalhes",
"errorServer": "Garanta que o ficheiro é servido via servidor local (não file://)",
"placeholderEmpty": "Deixe em branco para ocultar",
"weatherConditions": {
"sunny": "Ensolarado",
"clear": "Limpo",
"clearNight": "Noite limpa",
"partlyCloudy": "Parcialmente nublado",
"cloudy": "Nublado",
"rainy": "Chuvoso",
"pouring": "Chuva forte",
"snowy": "Com neve",
"sleet": "Chuva com neve",
"hail": "Granizo",
"foggy": "Nevoeiro",
"lightning": "Relâmpagos",
"thunderstorm": "Trovoada"
},
"language": {
"title": "Idioma",
"english": "Inglês",
"russian": "Russo",
"french": "Francês",
"german": "Alemão",
"dutch": "Holandês",
"spanish": "Espanhol",
"italian": "Italiano",
"slovak": "Eslovaco",
"hungarian": "Húngaro"
}
}
}
1 change: 1 addition & 0 deletions src/internationalization/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Итальянский",
"language_sk": "Словацкий",
"language_hu": "Венгерский",
"language_pt": "Португальский",
"wind_speed_unit": "Единицы скорости ветра",
"wind_speed_unit_ms": "м/с",
"wind_speed_unit_kmh": "км/ч"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/locales/sk/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"language_it": "Taliančina",
"language_sk": "Slovenčina",
"language_hu": "Maďarčina",
"language_pt": "Portugalčina",
"wind_speed_unit": "Jednotka rýchlosti vetra",
"wind_speed_unit_ms": "m/s",
"wind_speed_unit_kmh": "km/h"
Expand Down
1 change: 1 addition & 0 deletions src/internationalization/resolveLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const resolveLanguage = ({ configLang, hassLang }: ResolveLanguageOptions
if (lang.startsWith('es')) return 'es';
if (lang.startsWith('sk')) return 'sk';
if (lang.startsWith('hu')) return 'hu';
if (lang.startsWith('pt')) return 'pt';
}

return 'en';
Expand Down
3 changes: 2 additions & 1 deletion src/internationalization/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export interface EditorTranslations {
language_it: string;
language_sk: string;
language_hu: string;
language_pt: string;
wind_speed_unit: string;
wind_speed_unit_ms: string;
wind_speed_unit_kmh: string;
Expand Down Expand Up @@ -159,4 +160,4 @@ export interface Translation {
demo: DemoTranslations;
}

export type SupportedLanguage = 'en' | 'ru' | 'de' | 'nl' | 'fr' | 'es' | 'it' | 'sk' | 'hu';
export type SupportedLanguage = 'en' | 'ru' | 'de' | 'nl' | 'fr' | 'es' | 'it' | 'sk' | 'hu' | 'pt';