Implements a zero-dependency i18n framework with TypeScript type safety. Thanks to @gy212 for the original i18n infrastructure design (PR #89) and comprehensive translation files (PR #90-96) that inspired this implementation. ## New files (5) - src/i18n/en.ts: English translations (source of truth, ~270 keys), exports TranslationKey type for compile-time key completeness - src/i18n/zh.ts: Chinese translations, typed as Record<TranslationKey, string> - src/i18n/index.ts: translate() function with {param} interpolation, Locale type, SUPPORTED_LOCALES array - src/components/layout/I18nProvider.tsx: React Context provider, loads/persists locale preference via /api/settings/app - src/hooks/useTranslation.ts: useTranslation() hook returning { locale, setLocale, t } ## Infrastructure wiring - src/app/layout.tsx: I18nProvider wrapped inside ThemeProvider - src/app/api/settings/app/route.ts: added "locale" to ALLOWED_KEYS for persistence ## Language picker - src/components/settings/GeneralSection.tsx: added language selection dropdown (Select component) in Settings > General, using SUPPORTED_LOCALES and setLocale() ## String replacements (33 component files) All hardcoded user-facing strings replaced with t() calls: High priority (chat): - ChatListPanel.tsx: session list, search, empty state, relative time - NavRail.tsx: nav labels, theme toggle, auto-approve indicator - MessageInput.tsx: command descriptions, mode labels, attach tooltip - MessageList.tsx: empty state, load earlier, loading indicator - StreamingMessage.tsx: thinking, permission actions - chat/[id]/page.tsx: session title fallback Settings: - GeneralSection.tsx: update card, auto-approve section, warning dialog - SettingsLayout.tsx: title, description, sidebar labels - CliSettingsSection.tsx: form/json tabs, buttons, dynamic field labels (skipDangerousModePermissionPrompt etc.), Enabled/Disabled states - ProviderForm.tsx: dialog title, form labels, buttons - ProviderManager.tsx: status badges, delete dialog, section headers Extensions: - extensions/page.tsx: title, tab labels - SkillsManager.tsx: empty state, loading, search - SkillEditor.tsx: toolbar buttons, placeholder - SkillListItem.tsx: delete confirmation - CreateSkillDialog.tsx: form labels, scope, templates, validation Plugins: - McpManager.tsx: header, tabs, loading state - McpServerList.tsx: empty state, badges, field labels - McpServerEditor.tsx: dialog title, form labels, buttons - ConfigEditor.tsx: save/format buttons Layout: - RightPanel.tsx: panel header, open/close tooltips - FileTree.tsx: search placeholder, empty states - FilePreview.tsx: back button, line count, copy path - DocPreview.tsx: iframe title - ConnectionStatus.tsx: install prompts, version display - InstallWizard.tsx: phase descriptions, button labels - ImportSessionDialog.tsx: search, relative time, import buttons - FolderPicker.tsx: dialog title, loading, buttons - TaskList.tsx: filter tabs, input placeholder, empty states
77 lines
2.5 KiB
JSON
77 lines
2.5 KiB
JSON
{
|
|
"name": "codepilot",
|
|
"version": "0.13.0",
|
|
"private": true,
|
|
"author": {
|
|
"name": "op7418",
|
|
"email": "7418@openclaw.ai"
|
|
},
|
|
"description": "A native desktop GUI client for Claude Code",
|
|
"main": "dist-electron/main.js",
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "next build",
|
|
"start": "next start",
|
|
"lint": "eslint",
|
|
"electron:dev": "concurrently -k \"next dev\" \"wait-on http://localhost:3000 && electron .\"",
|
|
"electron:build": "next build && node scripts/build-electron.mjs",
|
|
"electron:pack": "npm run electron:build && electron-builder --config electron-builder.yml",
|
|
"electron:pack:mac": "npm run electron:build && electron-builder --mac --config electron-builder.yml",
|
|
"electron:pack:win": "npm run electron:build && electron-builder --win --config electron-builder.yml",
|
|
"electron:pack:linux": "npm run electron:build && electron-builder --linux --config electron-builder.yml"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/claude-agent-sdk": "^0.2.33",
|
|
"@hugeicons/core-free-icons": "^3.1.1",
|
|
"@hugeicons/react": "^1.1.4",
|
|
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
"@streamdown/cjk": "^1.0.1",
|
|
"@streamdown/code": "^1.0.1",
|
|
"@streamdown/math": "^1.0.1",
|
|
"@streamdown/mermaid": "^1.0.1",
|
|
"ai": "^6.0.73",
|
|
"ansi-to-react": "^6.2.6",
|
|
"better-sqlite3": "^12.6.2",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"lucide-react": "^0.563.0",
|
|
"motion": "^12.33.0",
|
|
"nanoid": "^5.1.6",
|
|
"next": "16.1.6",
|
|
"next-themes": "^0.4.6",
|
|
"radix-ui": "^1.4.3",
|
|
"react": "19.2.3",
|
|
"react-dom": "19.2.3",
|
|
"react-markdown": "^10.1.0",
|
|
"react-syntax-highlighter": "^16.1.0",
|
|
"rehype-raw": "^7.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"shiki": "^3.22.0",
|
|
"streamdown": "^2.1.0",
|
|
"tailwind-merge": "^3.4.0",
|
|
"use-stick-to-bottom": "^1.1.2",
|
|
"uuid": "^13.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.58.1",
|
|
"@tailwindcss/postcss": "^4",
|
|
"@types/better-sqlite3": "^7.6.13",
|
|
"@types/node": "^20",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
"@types/uuid": "^10.0.0",
|
|
"concurrently": "^9.2.1",
|
|
"electron": "^40.2.1",
|
|
"electron-builder": "^26.7.0",
|
|
"esbuild": "^0.27.3",
|
|
"eslint": "^9",
|
|
"eslint-config-next": "16.1.6",
|
|
"tailwindcss": "^4",
|
|
"tw-animate-css": "^1.4.0",
|
|
"typescript": "^5",
|
|
"wait-on": "^9.0.3"
|
|
}
|
|
}
|