diff --git a/src/components/CodeEditor.jsx b/src/components/CodeEditor.jsx
index e998d86..978dea3 100644
--- a/src/components/CodeEditor.jsx
+++ b/src/components/CodeEditor.jsx
@@ -12,8 +12,10 @@ import { unifiedMergeView, getChunks } from '@codemirror/merge';
import { showMinimap } from '@replit/codemirror-minimap';
import { X, Save, Download, Maximize2, Minimize2 } from 'lucide-react';
import { api } from '../utils/api';
+import { useTranslation } from 'react-i18next';
function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded = false, onToggleExpand = null }) {
+ const { t } = useTranslation('codeEditor');
const [content, setContent] = useState('');
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
@@ -125,13 +127,13 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
toolbarHTML += '
';
if (hasDiff) {
toolbarHTML += `
-
${chunkCount > 0 ? `${currentIndex + 1}/${chunkCount}` : '0'} changes
-
@@ -574,7 +576,7 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
{file.name}
{file.diffInfo && (
- Showing changes
+ {t('header.showingChanges')}
)}
@@ -586,7 +588,7 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
@@ -605,12 +607,12 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
- Saved!
+ {t('actions.saved')}
>
) : (
<>
- {saving ? 'Saving...' : 'Save'}
+ {saving ? t('actions.saving') : t('actions.save')}
>
)}
@@ -619,7 +621,7 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
{isFullscreen ? : }
@@ -628,7 +630,7 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
@@ -686,12 +688,12 @@ function CodeEditor({ file, onClose, projectPath, isSidebar = false, isExpanded
{/* Footer */}
- Lines: {content.split('\n').length}
- Characters: {content.length}
+ {t('footer.lines')} {content.split('\n').length}
+ {t('footer.characters')} {content.length}
- Press Ctrl+S to save • Esc to close
+ {t('footer.shortcuts')}
diff --git a/src/components/QuickSettingsPanel.jsx b/src/components/QuickSettingsPanel.jsx
index 93b7d07..6da0289 100644
--- a/src/components/QuickSettingsPanel.jsx
+++ b/src/components/QuickSettingsPanel.jsx
@@ -233,8 +233,8 @@ const QuickSettingsPanel = ({
isDragging ? 'cursor-grabbing' : 'cursor-pointer'
} touch-none`}
style={{ ...getPositionStyle(), touchAction: 'none', WebkitTouchCallout: 'none', WebkitUserSelect: 'none' }}
- aria-label={isDragging ? 'Dragging handle' : localIsOpen ? 'Close settings panel' : 'Open settings panel'}
- title={isDragging ? 'Dragging...' : 'Click to toggle, drag to move'}
+ aria-label={isDragging ? t('quickSettings.dragHandle.dragging') : localIsOpen ? t('quickSettings.dragHandle.closePanel') : t('quickSettings.dragHandle.openPanel')}
+ title={isDragging ? t('quickSettings.dragHandle.draggingStatus') : t('quickSettings.dragHandle.toggleAndMove')}
>
{isDragging ? (
@@ -383,10 +383,10 @@ const QuickSettingsPanel = ({
- Default Mode
+ {t('quickSettings.whisper.modes.default')}
- Direct transcription of your speech
+ {t('quickSettings.whisper.modes.defaultDescription')}
@@ -407,10 +407,10 @@ const QuickSettingsPanel = ({
- Prompt Enhancement
+ {t('quickSettings.whisper.modes.prompt')}
- Transform rough ideas into clear, detailed AI prompts
+ {t('quickSettings.whisper.modes.promptDescription')}
@@ -431,10 +431,10 @@ const QuickSettingsPanel = ({
- Vibe Mode
+ {t('quickSettings.whisper.modes.vibe')}
- Format ideas as clear agent instructions with details
+ {t('quickSettings.whisper.modes.vibeDescription')}
diff --git a/src/i18n/config.js b/src/i18n/config.js
index 789b993..5d3889f 100644
--- a/src/i18n/config.js
+++ b/src/i18n/config.js
@@ -19,12 +19,14 @@ import enSettings from './locales/en/settings.json';
import enAuth from './locales/en/auth.json';
import enSidebar from './locales/en/sidebar.json';
import enChat from './locales/en/chat.json';
+import enCodeEditor from './locales/en/codeEditor.json';
import zhCommon from './locales/zh-CN/common.json';
import zhSettings from './locales/zh-CN/settings.json';
import zhAuth from './locales/zh-CN/auth.json';
import zhSidebar from './locales/zh-CN/sidebar.json';
import zhChat from './locales/zh-CN/chat.json';
+import zhCodeEditor from './locales/zh-CN/codeEditor.json';
// Import supported languages configuration
import { languages } from './languages.js';
@@ -56,6 +58,7 @@ i18n
auth: enAuth,
sidebar: enSidebar,
chat: enChat,
+ codeEditor: enCodeEditor,
},
'zh-CN': {
common: zhCommon,
@@ -63,6 +66,7 @@ i18n
auth: zhAuth,
sidebar: zhSidebar,
chat: zhChat,
+ codeEditor: zhCodeEditor,
},
},
@@ -76,7 +80,7 @@ i18n
debug: import.meta.env.DEV,
// Namespaces - load only what's needed
- ns: ['common', 'settings', 'auth', 'sidebar', 'chat'],
+ ns: ['common', 'settings', 'auth', 'sidebar', 'chat', 'codeEditor'],
defaultNS: 'common',
// Key separator for nested keys (default: '.')
diff --git a/src/i18n/locales/en/codeEditor.json b/src/i18n/locales/en/codeEditor.json
new file mode 100644
index 0000000..11808a4
--- /dev/null
+++ b/src/i18n/locales/en/codeEditor.json
@@ -0,0 +1,30 @@
+{
+ "toolbar": {
+ "changes": "changes",
+ "previousChange": "Previous change",
+ "nextChange": "Next change",
+ "hideDiff": "Hide diff highlighting",
+ "showDiff": "Show diff highlighting",
+ "settings": "Editor Settings",
+ "collapse": "Collapse editor",
+ "expand": "Expand editor to full width"
+ },
+ "loading": "Loading {{fileName}}...",
+ "header": {
+ "showingChanges": "Showing changes"
+ },
+ "actions": {
+ "download": "Download file",
+ "save": "Save",
+ "saving": "Saving...",
+ "saved": "Saved!",
+ "exitFullscreen": "Exit fullscreen",
+ "fullscreen": "Fullscreen",
+ "close": "Close"
+ },
+ "footer": {
+ "lines": "Lines:",
+ "characters": "Characters:",
+ "shortcuts": "Press Ctrl+S to save • Esc to close"
+ }
+}
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index c015592..12f9737 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -64,7 +64,24 @@
"showThinking": "Show thinking",
"autoScrollToBottom": "Auto-scroll to bottom",
"sendByCtrlEnter": "Send by Ctrl+Enter",
- "sendByCtrlEnterDescription": "When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends."
+ "sendByCtrlEnterDescription": "When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends.",
+ "dragHandle": {
+ "dragging": "Dragging handle",
+ "closePanel": "Close settings panel",
+ "openPanel": "Open settings panel",
+ "draggingStatus": "Dragging...",
+ "toggleAndMove": "Click to toggle, drag to move"
+ },
+ "whisper": {
+ "modes": {
+ "default": "Default Mode",
+ "defaultDescription": "Direct transcription of your speech",
+ "prompt": "Prompt Enhancement",
+ "promptDescription": "Transform rough ideas into clear, detailed AI prompts",
+ "vibe": "Vibe Mode",
+ "vibeDescription": "Format ideas as clear agent instructions with details"
+ }
+ }
},
"mainTabs": {
"agents": "Agents",
diff --git a/src/i18n/locales/zh-CN/codeEditor.json b/src/i18n/locales/zh-CN/codeEditor.json
new file mode 100644
index 0000000..1286112
--- /dev/null
+++ b/src/i18n/locales/zh-CN/codeEditor.json
@@ -0,0 +1,30 @@
+{
+ "toolbar": {
+ "changes": "个更改",
+ "previousChange": "上一个更改",
+ "nextChange": "下一个更改",
+ "hideDiff": "隐藏差异高亮",
+ "showDiff": "显示差异高亮",
+ "settings": "编辑器设置",
+ "collapse": "折叠编辑器",
+ "expand": "展开编辑器到全宽"
+ },
+ "loading": "正在加载 {{fileName}}...",
+ "header": {
+ "showingChanges": "显示更改"
+ },
+ "actions": {
+ "download": "下载文件",
+ "save": "保存",
+ "saving": "保存中...",
+ "saved": "已保存!",
+ "exitFullscreen": "退出全屏",
+ "fullscreen": "全屏",
+ "close": "关闭"
+ },
+ "footer": {
+ "lines": "行数:",
+ "characters": "字符数:",
+ "shortcuts": "按 Ctrl+S 保存 • Esc 关闭"
+ }
+}
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 9aaaec9..24dd6c1 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -64,7 +64,24 @@
"showThinking": "显示思考过程",
"autoScrollToBottom": "自动滚动到底部",
"sendByCtrlEnter": "使用 Ctrl+Enter 发送",
- "sendByCtrlEnterDescription": "启用后,按 Ctrl+Enter 发送消息,而不是仅按 Enter。这对于使用输入法的用户可以避免意外发送。"
+ "sendByCtrlEnterDescription": "启用后,按 Ctrl+Enter 发送消息,而不是仅按 Enter。这对于使用输入法的用户可以避免意外发送。",
+ "dragHandle": {
+ "dragging": "正在拖拽手柄",
+ "closePanel": "关闭设置面板",
+ "openPanel": "打开设置面板",
+ "draggingStatus": "正在拖拽...",
+ "toggleAndMove": "点击切换,拖拽移动"
+ },
+ "whisper": {
+ "modes": {
+ "default": "默认模式",
+ "defaultDescription": "直接转录您的语音",
+ "prompt": "提示词增强",
+ "promptDescription": "将粗略的想法转化为清晰、详细的 AI 提示词",
+ "vibe": "Vibe 模式",
+ "vibeDescription": "将想法格式化为带有详细说明的清晰智能体指令"
+ }
+ }
},
"mainTabs": {
"agents": "智能体",