Skip to content

Commit de92005

Browse files
Saúl Gómez Jiménezclaude
authored andcommitted
feat: add Spanish translations for log viewer controls
- Create logs.json translation files for English and Spanish - Add "Start Watching" / "Iniciar Escucha" translations - Add "Stop Watching" / "Detener Escucha" translations - Update LogViewerControls to use i18n translations - Register logs namespace in i18n config The log viewer now supports both English and Spanish languages, automatically switching based on user preferences. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e413864 commit de92005

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

src/renderer/components/logViewer/LogViewerControls.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { Button } from '@/components/ui/button';
22
import { Play, Square } from 'lucide-react';
3+
import { useTranslation } from 'react-i18next';
34
import { useLogViewerStore } from '@/stores/logViewerStore';
45

56
/**
67
* Controls for starting/stopping log watching
78
*/
89
export function LogViewerControls() {
10+
const { t } = useTranslation('logs');
911
const { isWatching, loading, startWatching, stopWatching } = useLogViewerStore();
1012

1113
return (
@@ -18,12 +20,12 @@ export function LogViewerControls() {
1820
disabled={loading}
1921
>
2022
<Square className="h-4 w-4 mr-2" />
21-
Stop Watching
23+
{t('controls.stop_watching')}
2224
</Button>
2325
) : (
2426
<Button variant="default" size="sm" onClick={startWatching} disabled={loading}>
2527
<Play className="h-4 w-4 mr-2" />
26-
Start Watching
28+
{t('controls.start_watching')}
2729
</Button>
2830
)}
2931
</div>

src/renderer/i18n/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import enModels from '../locales/en/models.json';
1010
import enWizard from '../locales/en/wizard.json';
1111
import enMCP from '../locales/en/mcp.json';
1212
import enErrors from '../locales/en/errors.json';
13+
import enLogs from '../locales/en/logs.json';
1314

1415
import esCommon from '../locales/es/common.json';
1516
import esSettings from '../locales/es/settings.json';
@@ -18,6 +19,7 @@ import esModels from '../locales/es/models.json';
1819
import esWizard from '../locales/es/wizard.json';
1920
import esMCP from '../locales/es/mcp.json';
2021
import esErrors from '../locales/es/errors.json';
22+
import esLogs from '../locales/es/logs.json';
2123

2224
const resources = {
2325
en: {
@@ -28,6 +30,7 @@ const resources = {
2830
wizard: enWizard,
2931
mcp: enMCP,
3032
errors: enErrors,
33+
logs: enLogs,
3134
},
3235
es: {
3336
common: esCommon,
@@ -37,6 +40,7 @@ const resources = {
3740
wizard: esWizard,
3841
mcp: esMCP,
3942
errors: esErrors,
43+
logs: esLogs,
4044
},
4145
};
4246

src/renderer/locales/en/logs.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"controls": {
3+
"start_watching": "Start Watching",
4+
"stop_watching": "Stop Watching"
5+
},
6+
"filters": {
7+
"categories": "Categories",
8+
"levels": "Levels",
9+
"search": "Search logs...",
10+
"clear": "Clear Logs",
11+
"auto_scroll": "Auto Scroll"
12+
},
13+
"status": {
14+
"watching": "Watching logs",
15+
"stopped": "Stopped",
16+
"loading": "Loading logs..."
17+
}
18+
}

src/renderer/locales/es/logs.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"controls": {
3+
"start_watching": "Iniciar Escucha",
4+
"stop_watching": "Detener Escucha"
5+
},
6+
"filters": {
7+
"categories": "Categorías",
8+
"levels": "Niveles",
9+
"search": "Buscar en logs...",
10+
"clear": "Limpiar Logs",
11+
"auto_scroll": "Desplazamiento Automático"
12+
},
13+
"status": {
14+
"watching": "Escuchando logs",
15+
"stopped": "Detenido",
16+
"loading": "Cargando logs..."
17+
}
18+
}

0 commit comments

Comments
 (0)