From 26b5ae9a0db3b9e24d1a58a32589edf111a7cee7 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Wed, 26 Aug 2026 07:12:27 +0200 Subject: [PATCH] =?UTF-8?q?refactor(i-g):=20ProactiveAISettings=20hardcode?= =?UTF-8?q?d=20Strings=20auf=20t()=20umgestellt=20=E2=80=94=20i18n-Hotspot?= =?UTF-8?q?=20Nr.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 15+ deutsche Hardcodes migriert: title/toggleDescription/categoriesTitle/categoriesDescription/confidenceThreshold/confidenceDescription/all/veryConfident/rateLimitTitle/rateLimitDescription/modelTitle/modelDescription/heartbeatTitle/heartbeatDescription/heartbeatEnable/interval/targetRoom/targetRoomDescription/defaultRoomName + categoryKeys auf proactiveAI.categories.*-Keys umgestellt (categoryLabels-Record durch t()-basierte Keys ersetzt) + modelOptions-Labels inline mit t()-Keys. Beweis: tsc exit=0; ProactiveAISettings-Tests 10/10 gruen. --- frontend/src/i18n/locales/de.json | 36 ++++++++++ frontend/src/i18n/locales/en.json | 36 ++++++++++ frontend/src/pages/ProactiveAISettings.tsx | 77 +++++++++------------- 3 files changed, 102 insertions(+), 47 deletions(-) diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json index 50ed47a..4bdc859 100644 --- a/frontend/src/i18n/locales/de.json +++ b/frontend/src/i18n/locales/de.json @@ -1404,5 +1404,41 @@ "defaultProvider": "Standard-Anbieter", "defaultTag": "(Standard)", "confirmDeleteProvider": "Anbieter wirklich löschen?" + }, + "proactiveAI": { + "categories": { + "mail": "E-Mails", + "tasks": "Aufgaben", + "contacts": "Kontakte", + "companies": "Firmen", + "insights": "Erkenntnisse" + }, + "models": { + "deepseekV4": "DeepSeek V4 (empfohlen)", + "deepseekV4Pro": "DeepSeek V4 Pro (präzise)", + "llama32": "Llama 3.2 (Alternative)", + "gpt4oMiniOllama": "GPT-4o mini via Ollama", + "gpt4oMiniDirect": "GPT-4o mini (Direct OpenAI)" + }, + "loading": "Lade Einstellungen...", + "title": "Proaktive KI", + "toggleDescription": "Aktiviert oder deaktiviert alle Vorschläge", + "categoriesTitle": "Kategorien", + "categoriesDescription": "Für welche Bereiche sollen Vorschläge generiert werden?", + "confidenceThreshold": "Confidence Schwellwert", + "confidenceDescription": "Nur Vorschläge mit höherer Confidence anzeigen", + "all": "Alle", + "veryConfident": "Sehr sicher", + "rateLimitTitle": "Rate Limit", + "rateLimitDescription": "Mindestabstand zwischen Vorschlägen", + "modelTitle": "KI Modell (Ollama Cloud)", + "modelDescription": "Wähle das Modell für Vorschläge. DeepSeek V4 ist empfohlen für beste Performance/Kosten.", + "heartbeatTitle": "Heartbeat", + "heartbeatDescription": "Regelmäßige Status-Meldung an KI-Raum", + "heartbeatEnable": "Heartbeat aktivieren", + "interval": "Intervall", + "targetRoom": "Ziel-Raum", + "targetRoomDescription": "Name des Raums in der Kommunikation, an den Status-Meldungen gesendet werden.", + "defaultRoomName": "Live KI" } } diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index c0316b7..3cf840e 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -1404,5 +1404,41 @@ "defaultProvider": "Default provider", "defaultTag": "(default)", "confirmDeleteProvider": "Really delete provider?" + }, + "proactiveAI": { + "categories": { + "mail": "Emails", + "tasks": "Tasks", + "contacts": "Contacts", + "companies": "Companies", + "insights": "Insights" + }, + "models": { + "deepseekV4": "DeepSeek V4 (empfohlen)", + "deepseekV4Pro": "DeepSeek V4 Pro (präzise)", + "llama32": "Llama 3.2 (Alternative)", + "gpt4oMiniOllama": "GPT-4o mini via Ollama", + "gpt4oMiniDirect": "GPT-4o mini (Direct OpenAI)" + }, + "loading": "Loading settings...", + "title": "Proactive AI", + "toggleDescription": "Enables or disables all suggestions", + "categoriesTitle": "Categories", + "categoriesDescription": "Which areas should suggestions be generated for?", + "confidenceThreshold": "Confidence threshold", + "confidenceDescription": "Only show suggestions with higher confidence", + "all": "All", + "veryConfident": "Very confident", + "rateLimitTitle": "Rate limit", + "rateLimitDescription": "Minimum distance between suggestions", + "modelTitle": "AI Model (Ollama Cloud)", + "modelDescription": "Choose the model for suggestions. DeepSeek V4 is recommended for best performance/cost.", + "heartbeatTitle": "Heartbeat", + "heartbeatDescription": "Regular status messages to the AI room", + "heartbeatEnable": "Enable heartbeat", + "interval": "Interval", + "targetRoom": "Target room", + "targetRoomDescription": "Name of the room in Communication that status messages are sent to.", + "defaultRoomName": "Live AI" } } diff --git a/frontend/src/pages/ProactiveAISettings.tsx b/frontend/src/pages/ProactiveAISettings.tsx index effabc1..9fe657e 100644 --- a/frontend/src/pages/ProactiveAISettings.tsx +++ b/frontend/src/pages/ProactiveAISettings.tsx @@ -1,29 +1,16 @@ +import { useTranslation } from 'react-i18next'; import { useProactiveSettings } from '@/api/aiProactive'; -// TODO: P2-T20 — Replace hardcoded categoryLabels/modelOptions with backend config -const categoryLabels: Record = { - mail: 'E-Mails', - tasks: 'Aufgaben', - contacts: 'Kontakte', - companies: 'Firmen', - insights: 'Erkenntnisse', -}; - -const modelOptions = [ - { value: 'ollama/deepseek-v4', label: 'DeepSeek V4 (empfohlen)' }, - { value: 'ollama/deepseek-v4-pro', label: 'DeepSeek V4 Pro (präzise)' }, - { value: 'ollama/llama3.2', label: 'Llama 3.2 (Alternative)' }, - { value: 'ollama/gpt-4o-mini', label: 'GPT-4o mini via Ollama' }, - { value: 'gpt-4o-mini', label: 'GPT-4o mini (Direct OpenAI)' }, -]; +const categoryKeys = ['mail', 'tasks', 'contacts', 'companies', 'insights']; export function ProactiveAISettings() { + const { t } = useTranslation(); const { settings, update } = useProactiveSettings(); if (!settings) { return (
-
Lade Einstellungen...
+
{t('proactiveAI.loading')}
); } @@ -41,8 +28,8 @@ export function ProactiveAISettings() { {/* Enable/Disable */}
-

Proaktive KI

-

Aktiviert oder deaktiviert alle Vorschläge

+

{t('proactiveAI.title')}

+

{t('proactiveAI.toggleDescription')}