feat(i18n): migrate hardcoded German strings to t() across 104 components/pages — AST-based batch with re-parse gate, 423 new de.json keys; tsc clean; vitest failures byte-identical to clean-tree baseline (pre-existing)

This commit is contained in:
Agent Zero
2026-08-27 01:43:06 +02:00
parent 5680179260
commit 4cb5298768
105 changed files with 1204 additions and 459 deletions
@@ -3,6 +3,7 @@ import React, { useState, useRef, useEffect, useCallback } from 'react';
import { Sparkles, Send } from 'lucide-react';
import { streamChat, fetchMessages } from '@/api/ai';
import { apiClient } from '@/api/client';
import { useTranslation } from 'react-i18next';
interface AiChatPanelProps {
windowTitle: string;
@@ -16,6 +17,7 @@ interface SimpleMessage {
}
export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
const { t } = useTranslation();
const [messages, setMessages] = useState<SimpleMessage[]>([]);
const [input, setInput] = useState('');
const [isStreaming, setIsStreaming] = useState(false);
@@ -118,10 +120,10 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
<div className="flex flex-col h-full">
<div className="px-4 py-2 border-b border-secondary-200 bg-secondary-50 flex items-center gap-2">
<Sparkles className="w-4 h-4 text-primary-500" />
<span className="text-sm font-semibold text-secondary-700">KI Assistent</span>
<span className="text-sm font-semibold text-secondary-700">{t('aiChatPanel.kiassistent')}</span>
</div>
<div className="flex-1 flex items-center justify-center text-sm text-secondary-400">
Verbinde mit KI...
{t('aiChatPanel.verbindemitki')}
</div>
</div>
);
@@ -132,7 +134,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
<div className="flex flex-col h-full">
<div className="px-4 py-2 border-b border-secondary-200 bg-secondary-50 flex items-center gap-2">
<Sparkles className="w-4 h-4 text-primary-500" />
<span className="text-sm font-semibold text-secondary-700">KI Assistent</span>
<span className="text-sm font-semibold text-secondary-700">{t('aiChatPanel.kiassistent')}</span>
</div>
<div className="flex-1 flex items-center justify-center p-4 text-center">
<div>
@@ -149,7 +151,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
{/* Header */}
<div className="px-4 py-2 border-b border-secondary-200 bg-secondary-50 flex items-center gap-2">
<Sparkles className="w-4 h-4 text-primary-500" />
<span className="text-sm font-semibold text-secondary-700">KI Assistent</span>
<span className="text-sm font-semibold text-secondary-700">{t('aiChatPanel.kiassistent')}</span>
</div>
{/* Context info */}
@@ -161,7 +163,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
<div ref={scrollRef} className="flex-1 overflow-y-auto p-4 space-y-2">
{messages.length === 0 && !streamingContent && (
<p className="text-sm text-secondary-400 text-center mt-4">
Stelle eine Frage zum aktuellen Fenster...
{t('aiChatPanel.stelleeinefragezumaktuellenfenster')}
</p>
)}
{messages.map((msg) => (
@@ -193,7 +195,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={handleKeyDown}
placeholder="Nachricht eingeben..."
placeholder={t('aiChatPanel.nachrichteingeben')}
rows={1}
className="flex-1 px-3 py-2 text-sm rounded-md border border-secondary-300 focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none"
disabled={isStreaming}
@@ -202,7 +204,7 @@ export function AiChatPanel({ windowTitle, windowType }: AiChatPanelProps) {
onClick={handleSend}
disabled={!input.trim() || isStreaming}
className="p-2 rounded-md bg-primary-600 text-white hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed"
aria-label="Senden"
aria-label={t('aiChatPanel.senden')}
>
<Send className="w-4 h-4" />
</button>
+8 -6
View File
@@ -3,12 +3,14 @@ import clsx from 'clsx';
import { Sparkles, Maximize2, Minimize2, Minus, X } from 'lucide-react';
import { useWindowStore, type WindowState } from '@/store/windowStore';
import { AiChatPanel } from './AiChatPanel';
import { useTranslation } from 'react-i18next';
interface WindowProps {
window: WindowState;
}
export function Window({ window: win }: WindowProps) {
const { t } = useTranslation();
const {
closeWindow,
minimizeWindow,
@@ -106,8 +108,8 @@ export function Window({ window: win }: WindowProps) {
'p-1.5 rounded hover:bg-secondary-200',
win.aiChatVisible && 'bg-primary-100 text-primary-600'
)}
aria-label="KI Chat ein/aus"
title="KI Chat"
aria-label={t('window.kichateinaus')}
title={t('window.kichat')}
>
<Sparkles className="w-4 h-4" />
</button>
@@ -128,8 +130,8 @@ export function Window({ window: win }: WindowProps) {
<button
onClick={() => minimizeWindow(win.id)}
className="p-1.5 rounded hover:bg-secondary-200"
aria-label="Minimieren"
title="Minimieren"
aria-label={t('window.minimieren')}
title={t('window.minimieren')}
>
<Minus className="w-4 h-4" />
</button>
@@ -137,8 +139,8 @@ export function Window({ window: win }: WindowProps) {
<button
onClick={() => closeWindow(win.id)}
className="p-1.5 rounded hover:bg-danger-100 hover:text-danger-600"
aria-label="Schließen"
title="Schließen"
aria-label={t('window.schließen')}
title={t('window.schließen')}
>
<X className="w-4 h-4" />
</button>