Skip to content

Commit

Permalink
feat: Add Spanish translation (#268)
Browse files Browse the repository at this point in the history
* Add Spanish translation

* Fix preset mode with Mi Home literals

---------

Co-authored-by: Sheyla Martinez <[email protected]>
  • Loading branch information
Sheyla1996 and Sheyla Martinez authored Sep 27, 2023
1 parent bd97c01 commit d3a7cd1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ This card supports translations. Please, help to add more translations and impro
- 繁體中文 (Traditional Chinese)
- Čeština (Czech)
- Dutch (Netherlands)
- Español (Spanish)
- [_Your language?_][add-translation]

## Supported models
Expand Down
2 changes: 2 additions & 0 deletions src/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import * as ru from './translations/ru.json';
import * as it from './translations/it.json';
import * as cs from './translations/cs.json';
import * as nl from './translations/nl.json';
import * as es from './translations/es.json';

type Translations = {
[key: string]: {
Expand All @@ -39,6 +40,7 @@ const languages: Record<string, Translations> = {
it,
cs,
nl,
es,
};

const DEFAULT_LANG = 'en';
Expand Down
37 changes: 37 additions & 0 deletions src/translations/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"common": {
"name": "Tarjeta Purificadora",
"description": "La tarjeta purificadora te permite controlar tu purificador inteligente.",
"not_available": "La entidad no está disponible",
"toggle_power": "Encender/Apagar"
},
"state": {
"on": "Encendido",
"off": "Apagado"
},
"preset_mode": {
"auto": "Automático",
"silent": "Nocturno",
"favorite": "Manual",
"fan": "Ventilador"
},
"error": {
"missing_entity": "¡Se requiere especificar la entidad!"
},
"editor": {
"entity": "Entidad (Requerido)",
"compact_view": "Vista Compacta",
"compact_view_aria_label_on": "Activar vista compacta",
"compact_view_aria_label_off": "Desactivar vista compacta",
"show_name": "Mostrar Nombre",
"show_name_aria_label_on": "Activar mostrar nombre",
"show_name_aria_label_off": "Desactivar mostrar nombre",
"show_state": "Mostrar Estado",
"show_state_aria_label_on": "Activar mostrar estado",
"show_state_aria_label_off": "Desactivar mostrar estado",
"show_toolbar": "Mostrar Barra de Herramientas",
"show_toolbar_aria_label_on": "Activar mostrar barra de herramientas",
"show_toolbar_aria_label_off": "Desactivar mostrar barra de herramientas",
"code_only_note": "Nota: La configuración de acciones y opciones de estadísticas solo está disponible mediante el Editor de Código."
}
}

0 comments on commit d3a7cd1

Please sign in to comment.