[Feature] 插件契约向后端、构建提供者和语言服务器传递界面语言(initialize.locale)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Start by reading the plugin contract's initialize definitions for backends, build providers, and language servers, then check how the host passes the current locale to Core. Update the contract, all three official SDKs, and the protocol update record to expose the LSP locale value. Done when each component receives the current BCP 47 interface language at startup and the contract changes are recorded.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
插件契约 v0 没有任何途径把 Lithe 的界面语言告诉插件后端、构建提供者和语言服务器。插件的 l10n/*.json 只能翻译清单里的静态文字;提供者在运行时返回给用户的错误说明(例如 Tomcat 插件的“没有设置 Tomcat,请在设置中选择安装目录”、Maven 插件的构建失败说明)只能用一种语言写死。中文界面的用户会看到英文提示,插件作者即使写了中文文案也无法按用户的界面语言选择。
目前只有插件网页(lithe.context.locale)能拿到界面语言;后端和提供者的 initialize 没有 locale,环境变量和启动参数变量里也没有。
Proposed solution / 建议方案
在契约中规定,Core 在后端、构建提供者和语言服务器的 initialize 参数里带上 LSP 标准字段 locale(Lithe 当前的界面语言,BCP 47 标记,如 zh-Hans、en),界面语言切换后按现有设置生效规则在下一次启动时更新;三个官方 SDK 暴露这个值,并在协议更新记录登记。宿主把当前界面语言传给 Core。
Target platform / 目标平台
Cross-platform / 跨平台
Area / 模块
Extensions / 扩展
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
- 插件读取操作系统语言(如 JVM 的
Locale.getDefault()):Lithe 的界面语言可以和系统语言不同,结果会和界面不一致,不采用。 - 提供者只返回错误码,由宿主翻译:错误种类由各插件定义,宿主无法为第三方插件维护文案。
Additional context / 补充信息
由 Tomcat 社区插件(lithe-plugin-tomcat)的宿主端到端测试发现。该插件已经按 initialize.locale 选择中英文,契约补上后无需修改即可生效;在此之前一律显示英文。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 3h 48m
- Merged PRs (30d)
- 571
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
1lck/Lithe-IDEA#2432 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 1/5 Under an hour Newbie friendliness 82/100
1lck/Lithe-IDEA#2431 ·
Maintainers usually reply within 1 day
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
area:ui enhancement P2 platform:cross-platform refactor review: high
Difficulty 1/5 Under an hour Newbie friendliness 84/100
1lck/Lithe-IDEA#2365 ·
Maintainers usually reply within 1 day
-
review: medium
Difficulty 3/5 1-2 days Newbie friendliness 57/100
1lck/Lithe-IDEA#2434 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
rel: fix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Deltares/fews-web-oc#2400 ·
Maintainers usually reply within 1 day
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on ClaudePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ardia-browser/ardia#4426 ·
Maintainers usually reply within 1 day
-
Bug report: isValidISODateDashOnly accepts text before or after the date-timePossibly taken @bardrop claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
pnp/cli-microsoft365#7713 ·
Maintainers usually reply within 1 day
-
Diagram: Journey Type: Bug / Error
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mermaid-js/mermaid-v13#1293 ·
Maintainers usually reply within 1 day