[Feature] 插件翻译文件支持构建系统的显示文字(运行项名称、构建选项和任务标题)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- json, typescript
调研方向
Start by reading the plugin contract README’s Translations section and the localization schema and fixtures; the issue says all need updates. Trace how Core loads translations and how the host displays build system names, run names, option titles, and task titles. Done means those fields can be translated by ID, invalid files are rejected as specified, and the protocol update is recorded.
由索引模型根据 Issue 内容生成。
描述
Problem to solve / 要解决的问题
插件的翻译文件(契约 README.md 的 Translations 一节,l10n/<locale>.json)目前只能翻译 settings、sections 和 settingActions。构建系统里同样会显示给用户的文字没有翻译入口,中文界面下只能显示 plugin.json 里的英文:
buildSystems[].displayName(构建窗口里的构建系统名)buildSystems[].run[].name(运行配置与构建窗口里的运行项名称,例如 Tomcat 插件的 “Run on Tomcat”)buildSystems[].options[].displayName(构建选项标题,例如 Maven 插件的 “Offline”、“Skip Tests”)buildSystems[].tasks[].displayName(任务名)
create-lithe-plugin Skill 要求插件的用户可见文字至少有中英文,契约不能翻译的文字不得绕过,只能提契约变更。这些字段目前没有办法满足这条要求。在 Core main 8b91b32 上已确认。
Proposed solution / 建议方案
在插件翻译文件中增加一个 buildSystems 成员,按 ID 翻译上面这些显示文字,规则与 settings 一致:每个成员都可选;缺少的文字保持 plugin.json 的写法;ID、顺序和取值在各语言中不变;格式错误时 Core 整份拒绝该文件,使用 plugin.settings.invalidLocalization 或新的同类错误码。示例:
{
"buildSystems": {
"tomcat": {
"displayName": "Tomcat",
"run": { "tomcat": { "name": "在 Tomcat 上运行" } },
"options": { "offline": { "displayName": "离线" } },
"tasks": { "build": { "displayName": "构建" } }
}
}
}
同一个 Core PR 需要更新契约 README、翻译文件的 schema 和 fixture,并在协议更新记录中登记。宿主侧显示这些文字时,改为读取 Core 按界面语言给出的结果。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
Extensions / 扩展
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
- 在
plugin.json中直接写中文,或写中英混排:英文界面下会显示中文,不可取。 - 插件后端按界面语言返回名称:运行项和构建选项的名称来自清单,不经过后端,做不到;即使能做到,也是绕过契约,Skill 不允许。
- 宿主为插件补词条:违反“插件内容不进宿主”的规则。
Additional context / 补充信息
在 Lithe-IDEA/lithe-plugin-tomcat 新的构建提供者实现中发现:设置项都已翻译,只有运行项名称 “Run on Tomcat” 无法翻译。Maven 插件的构建选项标题也有同样的问题。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 151
- 平均合并
- 3 小时 48 分钟
- 30 天内合并 PR
- 571
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
1lck/Lithe-IDEA 的其他 Issue
-
review: medium
难度 2/5 1-3 小时 新手友好度 78/100
1lck/Lithe-IDEA#2432 ·
维护者通常 1 天内回复
-
review: medium
难度 1/5 1 小时以内 新手友好度 82/100
1lck/Lithe-IDEA#2431 ·
维护者通常 1 天内回复
-
refactor review: high
难度 2/5 1-3 小时 新手友好度 72/100
1lck/Lithe-IDEA#2376 ·
维护者通常 1 天内回复
-
area:ui enhancement P2 platform:cross-platform refactor review: high
难度 1/5 1 小时以内 新手友好度 84/100
1lck/Lithe-IDEA#2365 ·
维护者通常 1 天内回复
-
review: medium
难度 3/5 1-2 天 新手友好度 57/100
1lck/Lithe-IDEA#2434 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
posit-dev/positron-sas-extension#196 ·
维护者通常 1 天内回复
-
bug composer
难度 2/5 1-3 小时 新手友好度 82/100
inmanta/web-console#8037 ·
维护者通常 1 天内回复
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
bug: v5 dist/types/components.d.ts imports @stencil/core/runtime instead of ./stencil-public-runtime未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复