From 538caaa36ea2dad179c7c3c87745a25d0a39af99 Mon Sep 17 00:00:00 2001 From: HP Date: Tue, 29 Sep 2026 23:24:42 +0100 Subject: [PATCH] feat-spanish-portuguese-dashboard-locales --- lib/i18n/index.test.ts | 10 ++++++++++ lib/i18n/index.ts | 10 ++++++++-- lib/i18n/locales/es/dashboard.json | 26 ++++++++++++++++++++++++++ lib/i18n/locales/pt/dashboard.json | 26 ++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 lib/i18n/locales/es/dashboard.json create mode 100644 lib/i18n/locales/pt/dashboard.json diff --git a/lib/i18n/index.test.ts b/lib/i18n/index.test.ts index 22be56d..8e2cde5 100644 --- a/lib/i18n/index.test.ts +++ b/lib/i18n/index.test.ts @@ -32,4 +32,14 @@ describe('lib/i18n', () => { expect(i18n.t('dashboard:partialError', { count: 1 })).toBe("1 stream couldn’t load"); expect(i18n.t('dashboard:partialError', { count: 3 })).toBe("3 streams couldn’t load"); }); + + it('includes complete Spanish and Portuguese dashboard dictionaries', () => { + const es = i18n.getFixedT('es', 'dashboard'); + const pt = i18n.getFixedT('pt', 'dashboard'); + + expect(es('title')).toBe('Panel de control'); + expect(es('partialError', { count: 2 })).toBe('No se pudieron cargar 2 flujos'); + expect(pt('title')).toBe('Painel'); + expect(pt('partialError', { count: 2 })).toBe('Não foi possível carregar 2 fluxos'); + }); }); diff --git a/lib/i18n/index.ts b/lib/i18n/index.ts index 2ec9ae2..e78cb34 100644 --- a/lib/i18n/index.ts +++ b/lib/i18n/index.ts @@ -17,6 +17,8 @@ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; import dashboardEn from './locales/en/dashboard.json'; +import dashboardEs from './locales/es/dashboard.json'; +import dashboardPt from './locales/pt/dashboard.json'; if (!i18n.isInitialized) { i18n.use(initReactI18next).init({ @@ -24,6 +26,12 @@ if (!i18n.isInitialized) { en: { dashboard: dashboardEn, }, + es: { + dashboard: dashboardEs, + }, + pt: { + dashboard: dashboardPt, + }, }, lng: 'en', fallbackLng: 'en', @@ -34,8 +42,6 @@ if (!i18n.isInitialized) { // escape values passed through JSX. escapeValue: false, }, - // No secondary language yet — surfacing missing-key warnings would just - // be noise while only `en` exists (#558 is deliberately single-locale). returnEmptyString: false, }); } diff --git a/lib/i18n/locales/es/dashboard.json b/lib/i18n/locales/es/dashboard.json new file mode 100644 index 0000000..f2aae42 --- /dev/null +++ b/lib/i18n/locales/es/dashboard.json @@ -0,0 +1,26 @@ +{ + "title": "Panel de control", + "newStream": "Nuevo flujo", + "totalsFor": "Totales para", + "rangeTo": "hasta", + "stats": { + "activeStreams": "Flujos activos", + "receivingPerSecond": "Recibiendo /s", + "totalReceived": "Total recibido", + "senders": "Remitentes" + }, + "connectWallet": "Conecta tu billetera para ver tus flujos.", + "loadError": "No se pudieron cargar los flujos. Inténtalo de nuevo.", + "partialError_one": "No se pudo cargar {{count}} flujo", + "partialError_other": "No se pudieron cargar {{count}} flujos", + "retryLower": "reintentar", + "retrying": "Reintentando…", + "retryButton": "Reintentar", + "tabs": { + "receiving": "Recibiendo", + "sending": "Enviando" + }, + "noStreamsYet": "Aún no hay flujos {{tab}}.", + "createFirstStream": "Crea tu primer flujo", + "connectionRestoredMessage": "Tus flujos aparecerán aquí cuando se restablezca la conexión." +} diff --git a/lib/i18n/locales/pt/dashboard.json b/lib/i18n/locales/pt/dashboard.json new file mode 100644 index 0000000..ef8f4b9 --- /dev/null +++ b/lib/i18n/locales/pt/dashboard.json @@ -0,0 +1,26 @@ +{ + "title": "Painel", + "newStream": "Novo fluxo", + "totalsFor": "Totais para", + "rangeTo": "até", + "stats": { + "activeStreams": "Fluxos ativos", + "receivingPerSecond": "Recebendo /s", + "totalReceived": "Total recebido", + "senders": "Remetentes" + }, + "connectWallet": "Conecte sua carteira para ver seus fluxos.", + "loadError": "Não foi possível carregar os fluxos. Tente novamente.", + "partialError_one": "Não foi possível carregar {{count}} fluxo", + "partialError_other": "Não foi possível carregar {{count}} fluxos", + "retryLower": "tentar novamente", + "retrying": "Tentando novamente…", + "retryButton": "Tentar novamente", + "tabs": { + "receiving": "Recebendo", + "sending": "Enviando" + }, + "noStreamsYet": "Ainda não há fluxos {{tab}}.", + "createFirstStream": "Crie seu primeiro fluxo", + "connectionRestoredMessage": "Seus fluxos aparecerão aqui quando a conexão for restabelecida." +}