Skip to content
Open
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
16 changes: 15 additions & 1 deletion src/renderer/components/settings/SettingsGeneral.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export function SettingsGeneral() {
const { i18n, t } = useTranslation();
const settings = useAppStore((s) => s.settings);
const updateSettings = useAppStore((s) => s.updateSettings);
const currentLang = i18n.language.startsWith('zh') ? 'zh' : 'en';
// Normalize the active language to its base code so the highlight matches
// every supported language (e.g. "es-ES" -> "es", "zh-CN" -> "zh"), and map
// Norwegian variants (nb/nn) to the "no" locale we ship.
const baseLang = i18n.language.split('-')[0];
const currentLang = baseLang === 'nb' || baseLang === 'nn' ? 'no' : baseLang;
const [appVer, setAppVer] = useState('');
useEffect(() => {
try {
Expand All @@ -21,6 +25,16 @@ export function SettingsGeneral() {
const languages = [
{ code: 'en', nativeName: 'English' },
{ code: 'zh', nativeName: '中文' },
{ code: 'es', nativeName: 'Español' },
{ code: 'fr', nativeName: 'Français' },
{ code: 'de', nativeName: 'Deutsch' },
{ code: 'it', nativeName: 'Italiano' },
{ code: 'uk', nativeName: 'Українська' },
{ code: 'pl', nativeName: 'Polski' },
{ code: 'sv', nativeName: 'Svenska' },
{ code: 'no', nativeName: 'Norsk' },
{ code: 'nl', nativeName: 'Nederlands' },
{ code: 'ro', nativeName: 'Română' },
];

const themeOptions = [
Expand Down
46 changes: 44 additions & 2 deletions src/renderer/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import LanguageDetector from 'i18next-browser-languagedetector';

import enTranslations from './locales/en.json';
import zhTranslations from './locales/zh.json';
import esTranslations from './locales/es.json';
import frTranslations from './locales/fr.json';
import deTranslations from './locales/de.json';
import itTranslations from './locales/it.json';
import ukTranslations from './locales/uk.json';
import plTranslations from './locales/pl.json';
import svTranslations from './locales/sv.json';
import noTranslations from './locales/no.json';
import nlTranslations from './locales/nl.json';
import roTranslations from './locales/ro.json';

i18n
.use(LanguageDetector) // 自动检测浏览器语言
Expand All @@ -16,9 +26,41 @@ i18n
zh: {
translation: zhTranslations,
},
es: {
translation: esTranslations,
},
fr: {
translation: frTranslations,
},
de: {
translation: deTranslations,
},
it: {
translation: itTranslations,
},
uk: {
translation: ukTranslations,
},
pl: {
translation: plTranslations,
},
sv: {
translation: svTranslations,
},
no: {
translation: noTranslations,
},
nl: {
translation: nlTranslations,
},
ro: {
translation: roTranslations,
},
},
fallbackLng: 'en', // 默认语言
supportedLngs: ['en', 'zh'], // 支持的语言
// 默认语言;挪威语 nb/nn 回退到 no
fallbackLng: { nb: ['no'], nn: ['no'], default: ['en'] },
supportedLngs: ['en', 'zh', 'es', 'fr', 'de', 'it', 'uk', 'pl', 'sv', 'no', 'nl', 'ro'], // 支持的语言
nonExplicitSupportedLngs: true, // 接受区域变体,例如 es-ES → es、zh-CN → zh
interpolation: {
escapeValue: false, // React 已经处理了 XSS
},
Expand Down
954 changes: 954 additions & 0 deletions src/renderer/i18n/locales/de.json

Large diffs are not rendered by default.

40 changes: 39 additions & 1 deletion src/renderer/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,43 @@
"clearCoreConfirm": "Clear all global core memory? This cannot be undone.",
"rebuildSuccess": "Workspace memory rebuilt",
"clearWorkspaceSuccess": "Workspace memory cleared",
"clearCoreSuccess": "Core memory cleared"
"clearCoreSuccess": "Core memory cleared",
"runtimeTitle": "Runtime configuration",
"runtimeDescription": "By default this inherits the currently active API configuration. Here you mainly tune navigation depth, embedding, and the on-disk directory.",
"runtimeSaved": "Memory runtime configuration saved",
"saveRuntime": "Save runtime configuration",
"storageRoot": "Storage root",
"noWorkspace": "No workspace yet",
"maxNavSteps": "Navigation steps",
"ingestionConcurrency": "Rebuild concurrency",
"useEmbedding": "Enable embedding retrieval",
"evalEnabled": "Enable real-model evaluation",
"evalArtifactsRoot": "Evaluation artifacts directory",
"evalMaxRounds": "Evaluation rounds",
"promptIterationRounds": "Prompt iteration rounds",
"llmConfig": "Memory LLM",
"embeddingConfig": "Embedding",
"inheritActive": "Inherit active API",
"modelOverride": "Model override",
"baseUrlOverride": "Base URL override",
"apiKeyOverride": "API Key override",
"allSources": "All sources",
"groupRawSessions": "Raw sessions",
"sourceFile": "Source file",
"inspectSession": "Inspect session memory",
"inspectSessionHint": "Select a session or chunk from the results above to inspect it.",
"revealInFinder": "Reveal in Finder",
"rebuildAll": "Rebuild all memory",
"rebuildAllConfirm": "This will clear and rebuild all memory. Continue?",
"rebuildAllSuccess": "Rebuilt all memory: {{sessionCount}} session(s), {{workspaceCount}} source workspace(s)",
"filesTitle": "Raw file viewer",
"filesDescription": "View the core / unified experience / session_state / eval artifacts exactly as they are written to disk.",
"fileList": "File list",
"refreshFiles": "Refresh",
"noFiles": "No memory files yet",
"fileContent": "File content",
"emptyFile": "File is empty",
"selectFileHint": "Select a file on the left to view its raw JSON."
},
"language": {
"english": "English",
Expand Down Expand Up @@ -153,6 +189,8 @@
"configSetRenamed": "Config set renamed",
"configSetDeleted": "Config set deleted",
"configSetSwitched": "Config set switched",
"defaultConfigSetName": "Default",
"configSetFallbackName": "Config set {{index}}",
"provider": "API Provider",
"providerDescription": "Choose the provider family and the broad protocol style for this workspace.",
"apiKey": "API Key",
Expand Down
Loading
Loading