Migrate i18n for settings, panels, and command actions#103
Merged
Conversation
i18n 增加 settings.shortcut.*;Shortcut.vue 页面静态文案改用 t() (快捷键动作名 action.label 在 composable 中,后续单独迁移)。
i18n 增加 settings.cache.*;Cache.vue 模板文案与成功提示改用 t()。
i18n 增加 settings.logs.*;Logs.vue 模板文案改用 t()。至此设置面板各页静态文案均已接入 i18n。
i18n 新增 header.* 命名空间;AppHeader 的运行/停止/加载示例/历史/打开/保存/AI、 侧栏开关、布局切换、有新版本等文案改用 t()。
i18n 新增 status.* (含 ms/字符/LSP/终端 等插值文案); StatusBar 与 useStatusBar 的环境状态、执行耗时、LSP 状态、字符数、 终端提示均改用 t()。
i18n 新增 git.* 命名空间;GitPanel 的分支/暂存/更改/提交区文案、按钮、
标题与各 toast 提示改用 t()(含 {branch} 插值)。AI 生成提示词保持原样。
i18n 新增 dialog.*;GoToLine、QuickOpen 的占位符/提示/空状态/最近标记改用 t()
(含 {max}/{n} 插值)。
i18n 新增 search.*;SearchPanel 的搜索/替换占位符、计数、全部替换确认、 空状态与替换结果 toast 改用 t()(含 count/files/query/rep 插值)。
dialog.* 增加大纲相关键;Outline 占位符与空状态改用 t()。
i18n 新增 chat.*;AiAssistant 头部/关联状态/快捷动作标签/空状态/思考中/
停止/输入框、代码块复制&应用按钮与各 toast 改用 t()(含 {id} 插值)。
快捷动作发给 AI 的提示词保持原样。
- 内置 zh-CN/en 文案抽到 src/i18n/locales/*.json 作为初始化数据源 - 用户自定义语言包存本地数据库(KV: i18n-custom-locales),启动时与内置合并 - 新增「设置 → 语言包」(I18n.vue):列出/新增(基于某语言模板)/编辑 JSON/ 删除自定义/恢复内置默认,保存即存库并实时生效 - 界面语言下拉改读 availableLocales,用户新增语言会出现在其中 - main.ts 用 loadLocales 合并自定义并恢复上次语言 - .gitignore 放行 src/i18n/locales/*.json
启动/保存时对每个语言用 JSON 内置文案作底,深合并数据库自定义(DB 优先), 缺失的键回退到 JSON,而非整套替换。编辑器预填也显示合并后的完整文案。
标签增多后导航行超出宽度;nav 改 flex-nowrap + overflow-x-auto, 按钮 flex-shrink-0,溢出时横向滚动而非挤压/截断。
- dialog.* 增加命令面板占位/空状态键 - 新增 tabs.* 命名空间;EditorTabs 关闭/新建/右键菜单(关闭/关闭其他/ 关闭右侧/复制路径)与「未命名」改用 t()
新增 command.* 命名空间(含布局/主题分组、监听模式与 AI 预测的开关两态); App.vue 的 paletteCommands 标签改用 t(),随语言切换。
新增 shortcutAction.* 命名空间;useShortcuts 的动作 label 改由 i18n 按 id 提供 (actions 改为 computed 随语言更新),去掉硬编码中文。
新增 sidebar.*;Sidebar 标题/打开文件夹/刷新/最近、右键菜单(新建文件/ 文件夹、重命名、删除、在X中显示)、新建/重命名/删除确认弹窗与各 toast 改用 t() (reveal 标签与删除确认按平台/插值处理)。
新增 console.*;ConsoleOutput 的标题/执行中/已复制/复制&清空标题/耗时/
执行中/运行中/空状态文案改用 t()(耗时用 {n} 插值)。
新增 view.* 共享命名空间;Web/JSON/XML/YAML/Markdown/数据表/Excel 视图的
工具栏(标题/运行中/解析失败/树↔图/复制/清空/导出CSV/图表表格)、空状态、
耗时与解析失败 toast 改用 t()(含 {n}/{cols}/{rows} 插值)。
- 新增 db_connections.rs:独立表 + list/save/delete 命令,按 sort_order 排序 - useDbConnections 改走后端命令,启动时载入;首次发现旧 sql-connections KV 数据自动迁移并清理 - add/update/remove 保持同步签名,内部 fire-and-forget invoke,调用方无需改动
- 新增 history、sql、about、update、terminal、diag、preview、largeFile、diff、inlineGen、breadcrumb 命名空间 - 迁移 ExecutionHistory、SqlResultTable/SqlTableView/SqlSourceSelect/SchemaBrowser/AiSql/PivotTable、About、Update、Terminal、DiagnosticsPanel、PreviewPanel、LargeFileViewer、DiffView、InlineGenerate、Breadcrumbs - useDbConnections.activeLabel、useUpdateManager 状态文案改走 i18n.global.t - SchemaBrowser 循环变量 t→tbl,避免与 i18n 的 t 冲突
- 新增 settings.database/lsp/language/env 与 snippet 命名空间 - 迁移 setting/Database、setting/Lsp、setting/Language、setting/EnvironmentManager、SnippetManager - useLanguageSettings 的 tabsData/consoleTypes 改为 computed 走 i18n.global.t
- 新增 chart 命名空间(类型/空状态/字段映射说明/聚合/选项/导出等) - ChartPanel:CHART_META 文案改由 i18n 提供,chartTypes/aggOptions/sortOptions/scatterZones/exportItems 改为 computed - 迁移 VirtualTable、DataGraph、WorkflowGraph、TreeChart、BoxplotChart 的用户可见文案 - view 命名空间补充 zeroRows/expand/collapse/trigger/noSteps
- 新增 app 命名空间(运行输入区/编辑器头部/控制台/运行未保存弹窗/AI 预览/LSP 右键菜单/各类 toast) - 运行参数/stdin/环境变量、光标信息、字符/行数、未保存标记等全部走 i18n - AI 提示词与喂给 AI 的数据保持原样不迁移
- settings.general 增加保存主题/配置/GitHub 的提示 - settings.network 增加 CDN 加载/保存/测试相关提示
- 新增 toast 命名空间,集中文件/编辑器配置/插件配置/代码执行/语言切换/日志等提示 - useFileManager、useEditorConfig、usePluginConfig、useCodeExecution、useCodeMirrorEditor、useLanguageManager、useLogDirectory、useLogCleanup 改走 i18n.global.t - 执行输出区的停止/超时/错误文案与日志保留天数选项一并迁移
- 新增 ui 命名空间:Modal 关闭、Tabs 添加/关闭/空内容、Select 占位/搜索/无选项 - 默认 prop 文案去硬编码,改为调用方未传时回退 t(),可随语言切换 - JsonNode 折叠计数(项/键)、XlsxView 无表头列名(列N) 入 view 命名空间
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.