Skip to content
Merged
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
10 changes: 10 additions & 0 deletions lib/i18n/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
10 changes: 8 additions & 2 deletions lib/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@
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({
resources: {
en: {
dashboard: dashboardEn,
},
es: {
dashboard: dashboardEs,
},
pt: {
dashboard: dashboardPt,
},
},
lng: 'en',
fallbackLng: 'en',
Expand All @@ -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,
});
}
Expand Down
26 changes: 26 additions & 0 deletions lib/i18n/locales/es/dashboard.json
Original file line number Diff line number Diff line change
@@ -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."
}
26 changes: 26 additions & 0 deletions lib/i18n/locales/pt/dashboard.json
Original file line number Diff line number Diff line change
@@ -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."
}