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
27 changes: 27 additions & 0 deletions docs/features/high-priority-i18n-languages/plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# High Priority i18n Languages Plan

## Scope

Implement the requested locales by following the existing static i18n bundle pattern. The source of truth for required keys is `src/renderer/src/i18n/zh-CN`, with `en-US` as a secondary reference for shorter Latin-script phrasing.

## Implementation

- Create one locale directory per target locale under `src/renderer/src/i18n/`.
- Reuse the existing locale `index.ts` import/export shape for each new locale.
- Register new locale modules in `src/renderer/src/i18n/index.ts`.
- Add language options in `src/renderer/settings/components/DisplaySettings.vue`.
- Add new locale codes to `ConfigPresenter.getSystemLanguage()`, `ChatLanguage`, and the DeepChat settings Agent tool schema.
- Extend shared context-menu and error-message translations in `src/shared/i18n.ts`.
- Keep RTL handling unchanged because all requested locales are LTR.

## Validation

- Run a structural comparison against `zh-CN` for all target locale JSON files.
- Run `pnpm run format`.
- Run `pnpm run i18n`.
- Run `pnpm run lint`.

## Risks

- The largest risk is incomplete or malformed JSON translation files. Mitigation: validate parseability and exact key parity.
- Some UI strings may become long in German, Polish, Turkish, or Vietnamese. Mitigation: prefer natural but concise desktop UI wording and use English as a length reference where appropriate.
29 changes: 29 additions & 0 deletions docs/features/high-priority-i18n-languages/spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# High Priority i18n Languages

## User Stories

- As a DeepChat desktop user in Spain, Germany, Turkey, Indonesia, Malaysia, Italy, Poland, or Vietnam, I can select my language in Display settings and use the app with readable local UI text.
- As a user whose system locale is one of the supported locales, DeepChat can resolve the matching app language when language is set to System.
- As an Agent Skills user, product and technical names such as DeepChat, Agent, Skills, MCP, Dify, and model/provider names remain recognizable and are not mistranslated.

## Acceptance Criteria

- Add full renderer i18n bundles for `es-ES`, `de-DE`, `tr-TR`, `id-ID`, `ms-MY`, `it-IT`, `pl-PL`, and `vi-VN`.
- Each new locale has the same JSON files and key structure as `zh-CN`.
- New locales are registered in renderer, settings renderer, floating renderer, language selector options, system-locale matching, shared chat settings types, and DeepChat settings Agent tool language schema.
- Shared native menu and error-label translations support the new locales where the shared i18n helper is used.
- Translation wording follows the Chinese source meaning, with English used as length/reference for Latin-script languages.
- Product and domain terms stay untranslated where requested: DeepChat, Agent, Skills, MCP, Dify, model/provider brand names, API, JSON, URL, token, prompt, and similar technical identifiers.
- `pnpm run format`, `pnpm run i18n`, and `pnpm run lint` pass.

## Non-Goals

- No UI layout redesign.
- No new runtime language-loading architecture.
- No locale-specific date, number, or plural-rule behavior beyond existing vue-i18n support unless needed by validation.

## Constraints

- Preserve existing keys, placeholders, interpolation variables, markdown, and JSON syntax.
- Keep translations clear for desktop application users; avoid jargon-heavy or literal machine-style phrasing.
- Resolve implementation without `[NEEDS CLARIFICATION]` markers.
8 changes: 8 additions & 0 deletions docs/features/high-priority-i18n-languages/tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# High Priority i18n Languages Tasks

- [x] Create SDD artifacts for the i18n expansion.
- [x] Add translated locale bundles for `es-ES`, `de-DE`, `tr-TR`, `id-ID`, `ms-MY`, `it-IT`, `pl-PL`, and `vi-VN`.
- [x] Register all new locales in renderer and main-process language support.
- [x] Extend shared menu/error translations for the new locale codes.
- [x] Validate locale key parity and JSON parseability.
- [x] Run `pnpm run format`, `pnpm run i18n`, and `pnpm run lint`.
10 changes: 9 additions & 1 deletion src/main/presenter/configPresenter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,15 @@ export class ConfigPresenter implements IConfigPresenter {
'fa-IR',
'pt-BR',
'da-DK',
'he-IL'
'he-IL',
'es-ES',
'de-DE',
'tr-TR',
'id-ID',
'ms-MY',
'it-IT',
'pl-PL',
'vi-VN'
]

// Exact match
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ const SUPPORTED_LANGUAGES = [
'fa-IR',
'pt-BR',
'da-DK',
'he-IL'
'he-IL',
'es-ES',
'de-DE',
'tr-TR',
'id-ID',
'ms-MY',
'it-IT',
'pl-PL',
'vi-VN'
] as const satisfies readonly ChatLanguage[]

const SUPPORTED_THEMES = ['dark', 'light', 'system'] as const
Expand Down
10 changes: 9 additions & 1 deletion src/renderer/settings/components/DisplaySettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,15 @@ const languageOptions = [
{ value: 'fa-IR', label: 'فارسی (ایران)' },
{ value: 'pt-BR', label: 'Português (Brasil)' },
{ value: 'da-DK', label: 'Dansk' },
{ value: 'he-IL', label: 'עברית (ישראל)' }
{ value: 'he-IL', label: 'עברית (ישראל)' },
{ value: 'es-ES', label: 'Español (España)' },
{ value: 'de-DE', label: 'Deutsch (Deutschland)' },
{ value: 'tr-TR', label: 'Türkçe' },
{ value: 'id-ID', label: 'Bahasa Indonesia' },
{ value: 'ms-MY', label: 'Bahasa Melayu' },
{ value: 'it-IT', label: 'Italiano' },
{ value: 'pl-PL', label: 'Polski' },
{ value: 'vi-VN', label: 'Tiếng Việt' }
]

watch(selectedLanguage, async (newValue) => {
Expand Down
23 changes: 23 additions & 0 deletions src/renderer/src/i18n/de-DE/about.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"title": "DeepChat",
"description": "DeepChat ist ein plattformübergreifender KI-Client, der KI für mehr Menschen einfach zugänglich macht.",
"website": "Unsere Website besuchen",
"disclaimerButton": "Haftungsausschluss",
"feedbackButton": "Feedback",
"disclaimerTitle": "Nutzungsbedingungen",
"checkUpdateButton": "Nach Updates suchen",
"mockUpdateButton": "Heruntergeladenes Update simulieren",
"clearMockUpdateButton": "Simuliertes Update löschen",
"mockOnboardingButton": "Ersteinrichtungsassistent simulieren",
"updateChannel": "Update-Kanal",
"stableChannel": "Stabil",
"betaChannel": "Beta",
"deviceInfo": {
"title": "Geräteinformationen",
"platform": "Plattform",
"arch": "Architektur",
"cpuModel": "CPU-Modell",
"totalMemory": "Gesamtspeicher",
"osVersion": "Systemversion"
}
}
52 changes: 52 additions & 0 deletions src/renderer/src/i18n/de-DE/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"clickToOpen": "Zum Öffnen klicken",
"codeSnippet": "Codeausschnitt",
"function": "Funktion",
"class": "Klasse",
"reactComponent": "React-Komponente",
"moduleImport": "Modulimport",
"variableDefinition": "{name} Variablendefinition",
"markdownDocument": "Markdown-Dokument",
"htmlDocument": "HTML-Dokument",
"svgImage": "SVG-Bild",
"flowchart": "Flussdiagramm",
"sequenceDiagram": "Sequenzdiagramm",
"classDiagram": "Klassendiagramm",
"stateDiagram": "Zustandsdiagramm",
"erDiagram": "ER-Diagramm",
"ganttChart": "Gantt-Diagramm",
"pieChart": "Kreisdiagramm",
"mermaidDiagram": "Mermaid-Diagramm",
"flowchartOf": "Flussdiagramm von {name}",
"sequenceDiagramBetween": "Sequenzdiagramm zwischen {participants}",
"classDiagramOf": "Klassendiagramm von {name}",
"stateDiagramOf": "Zustandsdiagramm von {name}",
"erDiagramOf": "ER-Diagramm von {name}",
"pieChartOf": "Kreisdiagramm von {name}",
"unknownDocument": "Unbekanntes Dokument",
"preview": "Vorschau",
"code": "Code",
"export": "Exportieren",
"htmlPreviewTitle": "HTML-Vorschau",
"svgPreviewTitle": "SVG-Vorschau",
"copy": "Kopieren",
"copyAsImage": "Als Bild kopieren",
"copyImageSuccessDesc": "Bild wurde in die Zwischenablage kopiert",
"copyImageFailedDesc": "Bild konnte nicht in die Zwischenablage kopiert werden",
"copySuccess": "Kopiert",
"copySuccessDesc": "Inhalt wurde in die Zwischenablage kopiert",
"copyFailed": "Kopieren fehlgeschlagen",
"copyFailedDesc": "Inhalt konnte nicht in die Zwischenablage kopiert werden",
"desktop": "Desktop",
"tablet": "Tablet",
"mobile": "Mobil",
"responsive": "Responsiv",
"width": "Breite",
"height": "Höhe",
"sanitizingSvg": "SVG-Inhalt wird bereinigt...",
"svgSanitizationFailed": "SVG-Inhalt hat die Sicherheitsprüfung nicht bestanden",
"noSvgContent": "Kein SVG-Inhalt verfügbar",
"mermaid": {
"renderError": "Rendern fehlgeschlagen: {message}"
}
}
Loading