Repository navigation
feat(build): translate build option text through build.localizeOptions - #122
Merged
Merged
Conversation
Plugins may translate an option's displayName, description and declared choice titles under buildOptions.<buildSystemID>.<optionID> in l10n/<language>.json. build.localizeOptions takes the enabled build plugins' manifests and the interface language, names the files to read like runConfig.configurationTypes, and returns the manifests with the option text replaced, so every host surface that reads the manifest shows it. A file that does not fit is refused whole as plugin.build.invalidLocalization. Refs 1lck/Lithe-IDEA#2204 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
marked this pull request as ready for review
November 19, 2026 12:49
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明
构建选项的名称、说明和固定选项值的标题只能用插件清单里的英文,中文界面下 Maven 的 “Settings File”“Local Repository”“Offline” 都是英文。运行配置类型已经能用包内翻译文件
l10n/<语言>.json翻译,构建选项还不行。翻译文件新增
buildOptionsbuildOptions.<buildSystemID>.<optionID>: { displayName?, description?, choices?: { <value>: title } }。runConfigurationTypes一样:只替换清单里已有的文字,不改名、不增加、不调整顺序;字数限制和清单相同。以下情况整份文件拒绝,错误码plugin.build.invalidLocalization,宿主改用下一个候选文件或清单原文:description的选项写了说明。plugin-l10n.schema.json新增buildOptions和$defs.optionText。新命令
build.localizeOptions{ language?, plugins: [{ manifest, localizations? }] }。{ manifests, localizations }。manifests:每个插件一份,顺序与请求一致;替换了buildSystems[].options[]的displayName、description和选项值的title,其余原样保留。localizations:每个声明了构建选项的插件一份报告,格式与plugins.settings、runConfig.configurationTypes相同(readRequired、candidates、applied、rejected)。build.resolveOptions)、运行配置编辑器、工具栏开关和构建树的选项节点上,这些都读检测到的实例的清单。在检测前换掉清单,一处就能覆盖所有界面。翻译后的清单仍通过校验,选项 ID、值和参数都不变,所以计划和指纹不受影响(测试中对翻译后的清单重新做了校验)。rust/crates/build/src/option_text.rs;BuildCommand::LocalizeOptions已在协议表和分发器中注册。文档
plugin.build.invalidLocalization错误码、构建选项表和 Commands 一节。rust-core-api.md:命令表与请求/返回表新增build.localizeOptions,并补上 feat(build): report the implicit value of unset path options and option descriptions #120 新增的build.resolveOptions返回字段(description、implicitValue)。reference/domains/build-systems.md中英文同步。验证
build_option_text_is_translated_in_the_manifest,覆盖:cargo test -p lithe-build -p lithe-core -p lithe-plugin-manifest通过(lithe-core 859 项)。cargo clippy -D warnings、cargo fmt --check、verify-rust-core-comments.sh build、verify-platform-tests.mjs、verify-docs.mjs通过。🤖 Generated with Claude Code