Skip to content

Commit 671bc9f

Browse files
committed
🌐 Add Spanish translations to i18n implementation
Add Spanish (es) as a third supported language alongside English and French. This completes the internationalization support with a scalable dropdown language switcher. Changes: - Create 9 Spanish translation JSON files in public/locales/es/ - Update i18n.ts to import and register Spanish resources - Update next-i18next.config.js to include 'es' in locales array - Update LanguageSwitcher to include Spanish in dropdown - Update LanguageInitializer to validate Spanish locale - Add Spanish language entry to English and French header translations All translations maintain technical accuracy while providing natural Spanish equivalents. Variable interpolation ({{mac}}) and Unicode escape sequences (Copyleft symbol) are preserved.
1 parent 2bf6de9 commit 671bc9f

File tree

15 files changed

+88
-5
lines changed

15 files changed

+88
-5
lines changed

next-i18next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
i18n: {
33
defaultLocale: 'en',
4-
locales: ['en', 'fr'],
4+
locales: ['en', 'fr', 'es'],
55
},
66
localePath: typeof window === 'undefined' ? require('path').resolve('./public/locales') : '/locales',
77
reloadOnPrerender: process.env.NODE_ENV === 'development',

public/locales/en/header.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"languageSwitcher": {
44
"languages": {
55
"en": "English",
6-
"fr": "Français"
6+
"fr": "Français",
7+
"es": "Español"
78
}
89
}
910
}

public/locales/es/common.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"appTitle": "Open Edilkamin"
3+
}

public/locales/es/error.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"defaultTitle": "Error"
3+
}

public/locales/es/fireplace.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"title": "Chimenea: {{mac}}",
3+
"advanced": "Avanzado",
4+
"debug": "Depuración",
5+
"errors": {
6+
"deviceNotFound": "Dispositivo no encontrado",
7+
"deviceNotFoundBody": "La dirección proporcionada (\"{{mac}}\") no es válida o el dispositivo no está registrado.",
8+
"couldntFetchInfo": "No se pudo obtener la información del dispositivo.",
9+
"powerUpdateFailed": "Error al actualizar el estado de encendido",
10+
"powerUpdateBody": "No se pudo cambiar el estado de encendido. Por favor, inténtelo de nuevo.",
11+
"temperatureUpdateFailed": "Error al actualizar la temperatura",
12+
"temperatureUpdateBody": "No se pudo actualizar la temperatura. Por favor, inténtelo de nuevo."
13+
}
14+
}

public/locales/es/footer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"text": "Copyleft \uD83C\uDD2F Andre Miras 2022 - Open Edilkamin v"
3+
}

public/locales/es/header.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"about": "Acerca de",
3+
"languageSwitcher": {
4+
"languages": {
5+
"en": "English",
6+
"fr": "Français",
7+
"es": "Español"
8+
}
9+
}
10+
}

public/locales/es/home.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"title": "Chimeneas",
3+
"emptyState": "No hay chimeneas registradas, agregue una a continuación",
4+
"macPlaceholder": "aabbccddeeff",
5+
"validation": {
6+
"invalidMac": "Dirección MAC no válida.",
7+
"alreadyAdded": "Dispositivo ya agregado."
8+
}
9+
}

public/locales/es/login.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"usernamePlaceholder": "Nombre de usuario",
3+
"emailAriaLabel": "Correo electrónico",
4+
"passwordPlaceholder": "Contraseña",
5+
"passwordAriaLabel": "Contraseña",
6+
"button": "Iniciar sesión",
7+
"errors": {
8+
"couldntLogin": "No se pudo iniciar sesión",
9+
"unknownError": "Error de inicio de sesión desconocido"
10+
}
11+
}

public/locales/es/logout.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"button": "Cerrar sesión"
3+
}

0 commit comments

Comments
 (0)