Repository navigation
feat(i18n): add live launcher language switching - #43
ItzJerry317 wants to merge 2 commits into
Conversation
审查者指南数据结构添加持久化的启动器语言设置,并将每种受支持的界面语言映射到对应的 Minecraft 语言代码,同时保留独立的游戏语言覆盖设置。
实现实现前端目录查找、回退和插值,并在刷新已打开窗口时更新当前组件的区域设置。
用户界面添加语言选择器、保存所选语言、在数据目录重新加载后恢复选择器,并在不重建视图的情况下刷新依赖语言的占位文本和选择器。
翻译启动器的导航、账户、活动、实例、启动、设置、Java、配置文件创建、整合包、安装和下载调试界面及状态消息。
配置配置 Crowdin,使其在导出捆绑的英文源目录的同时导出简体中文目录,并将这两个目录纳入 REUSE 分类。
文档说明目录键和插值的约定、Crowdin 设置,以及目录验证测试命令。
测试验证启动器语言设置的默认值、持久化行为(独立于 Minecraft 语言覆盖设置),以及是否按预期的区域设置代码进行序列化。
检查翻译目录键和参数的一致性、区域设置查找及插值行为。
锁定文件和供应商代码在工作区锁定文件中记录新增的前端 JSON 依赖项。
忽略开发工作流中新增的生成文件或本地文件。
添加加载捆绑目录所需的前端 JSON 解析依赖项。
其他更改未归入其他类别的文件。
提示和命令与 Sourcery 交互
自定义使用体验访问你的控制面板,以便:
获取帮助Original review guide in EnglishReviewer's GuideData structuresAdd the persisted launcher-language setting and map each supported interface language to its Minecraft language code, while retaining the separate game-language override.
ImplementationImplement frontend catalog lookup, fallback and interpolation, and update the active component locale while refreshing open windows.
UIAdd the language picker, persist selections, restore the picker after data-directory reloads, and refresh language-dependent placeholders and selectors without rebuilding the view.
Translate the launcher’s navigation, account, activity, instance, launch, settings, Java, profile-creation, modpack, installation, and download-debug interfaces and status messages.
ConfigurationConfigure Crowdin to export Simplified Chinese alongside the bundled English source catalog, and classify both catalogs for REUSE.
DocumentationDocument catalog key and interpolation conventions, Crowdin setup, and the catalog validation test command.
TestsVerify the launcher-language setting defaults, persists independently of the Minecraft override, and serializes with the expected locale code.
Check translation catalog key and argument parity, locale lookup, and interpolation behavior.
Lock files and vendored codeRecord the new frontend JSON dependency in the workspace lockfile.
Ignore generated or local files introduced for the development workflow.
Add the frontend JSON parsing dependency needed to load the bundled catalogs.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Assisted-by: OpenAI Codex Signed-off-by: ItzJerry <85010676+ItzJerry317@users.noreply.github.com>
PR Summary by QodoAdd live English and Simplified Chinese launcher switching
AI Description
Merge Risk
|
Code Review by Qodo
1. Language saves bypass core services
|
There was a problem hiding this comment.
嘿——我发现了 7 个问题
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="apps/core/state/src/settings.rs" line_range="62" />
<code_context>
pub theme: ThemeChoice,
+ /// The language of the launcher interface.
+ #[serde(default)]
+ pub launcher_language: LauncherLanguage,
/// The initial Minecraft language, with an empty value following the launcher.
#[serde(default)]
</code_context>
<issue_to_address>
**Unsupported language resets settings**
When the settings file contains an unsupported `launcher_language` value, such as after a newer build adds a locale or the value is edited manually, `serde(default)` handles a missing field, not an unrecognized enum value, so deserializing `SettingsData` fails and the settings loader quarantines the entire file and uses defaults. The user loses the other settings until they restore the quarantined file.
Deserialize unknown language values to the default while keeping the rest of the settings document readable.
</issue_to_address>
### Comment 2
<location path="apps/frontend/src/panel/language.rs" line_range="108" />
<code_context>
+ data.launcher_language = selected
+ }) {
+ Ok(_) => {
+ settings.launcher_language = selected;
+ self.origin = Some(SettingsOrigin::Stored);
+ self.environment.clear_feedback();
</code_context>
<issue_to_address>
**Concurrent settings remain stale in memory**
When another launcher process changes a setting such as `default_game_language` after this window loads settings but before it changes the launcher language, `update_settings` returns the complete settings document read under the lock, but this branch discards it and updates only `launcher_language` in the window’s cached settings. A different launcher process’s concurrent game-language change therefore remains on disk but is absent from this window’s launch settings, so launching can use the wrong Minecraft language until reload.
Use the `SettingsData` returned by `update_settings` to refresh the cached settings and any dependent UI state after the write.
</issue_to_address>
### Comment 3
<location path="apps/core/state/src/settings.rs" line_range="61-62" />
<code_context>
memory: MemoryAllocation,
#[serde(default)]
pub theme: ThemeChoice,
+ /// The language of the launcher interface.
+ #[serde(default)]
+ pub launcher_language: LauncherLanguage,
/// The initial Minecraft language, with an empty value following the launcher.
#[serde(default)]
</code_context>
<issue_to_address>
**Older settings silently remain accepted**
When a saved settings document lacks `launcher_language`, `SettingsData` deserialization supplies `English` when an existing settings document lacks `launcher_language`, so the older document is still accepted as schema version 1 instead of being rejected as incompatible.
Do not use a serde default to accept documents that lack the new field; reject them according to the repository's schema policy.
</issue_to_address>
### Comment 4
<location path="apps/frontend/src/panel/accounts/third_party.rs" line_range="141" />
<code_context>
v_flex()
.gap_2()
- .child(Label::new("Choose a Minecraft profile"))
+ .child(Label::new(tr(cx, "accounts.third-party.choose-profile")))
.child(h_flex().gap_2().flex_wrap().children(buttons))
.into_any_element()
</code_context>
<issue_to_address>
**Chinese UI retains English controls**
When the launcher is set to Simplified Chinese and a user opens third-party sign-in, an account list, or instance memory controls, the catalog-backed labels switch, but `Form::render` still displays English sign-in statuses and field labels, while the account list and instance-memory controls also retain English text. Users who switch to Chinese see a mixed-language interface in these workflows.
Move the remaining user-visible strings and accessibility labels in these workflows into both catalogs and render them through the translation lookup.
Also at `apps/frontend/src/panel/accounts/render.rs:248`, `apps/frontend/src/panel/instances/instance_row.rs:240`.
</issue_to_address>
### Comment 5
<location path="apps/frontend/src/panel/instances/actions.rs" line_range="283" />
<code_context>
+ let message = format!(
+ "{} ({version}): {}",
+ directory.display(),
+ launch.message(cx)
+ );
match launch {
</code_context>
<issue_to_address>
**Recorded launch text stays stale**
When a launch entry is recorded before the user switches languages, `launch.message(cx)` is formatted into a `String` and retained by `ActivityLog`, so existing rows keep the old language while the rest of the panel updates.
Store launch activity in a form that can be translated again when each row is rendered.
Also at `apps/frontend/src/panel/instances/actions.rs:284`.
</issue_to_address>
### Comment 6
<location path="apps/frontend/src/panel/java/memory.rs" line_range="58-59" />
<code_context>
let view = cx.weak_entity();
let saved = settings.memory().manual_heap();
open_editor(
- "Minecraft memory".into(),
- "Automatic",
+ tr(cx, "settings.memory.title").into(),
+ tr(cx, "settings.memory.automatic"),
</code_context>
<issue_to_address>
**Open memory dialog keeps old language**
When the launcher language is switched while the global memory editor dialog is open, `open_editor` captures the localized title and inherited-mode label when the dialog opens, so switching languages while it is open rerenders the dialog with those strings frozen in the previous language while other labels update.
Store translation keys in the dialog/editor and resolve them during each render, including the dialog title.
</issue_to_address>
### Comment 7
<location path="apps/frontend/src/panel/accounts/render.rs" line_range="236-238" />
<code_context>
- .label("Use account")
+ .label(tr(cx, "accounts.use"))
.accessibility_label(format!(
"Use {} {} account",
account.name(),
- account_kind(id)
+ account_kind(id, cx)
))
.disabled(disabled || selected)
</code_context>
<issue_to_address>
**Account actions remain English**
When the launcher is set to Simplified Chinese and an account row is available, the accessibility-label templates stay hardcoded in English while only the interpolated account kind is translated, so screen-reader users hear mixed-language account actions after switching the launcher to Chinese.
Add localized accessibility-label templates to both catalogs and interpolate the account name and kind into them.
Also at `apps/frontend/src/panel/accounts/render.rs:250-253`.
</issue_to_address>Sourcery 评估
需要人工审查。 有 6 项发现需要先处理;所选的启动器语言会保存到设置中,并且在未明确配置游戏语言时,也会决定启动 Minecraft 时使用的语言。还原代码不会移除已保存的偏好设置,也不会撤销 Minecraft 已保存的任何游戏语言设置,不过影响范围有限,可以通过更改语言设置来修正。
阻塞性发现:apps/core/state/src/settings.rs:62、apps/frontend/src/panel/language.rs:108、apps/frontend/src/panel/accounts/third_party.rs:141、apps/frontend/src/panel/instances/actions.rs:283、apps/frontend/src/panel/java/memory.rs:59,以及另外 1 项
Original comment in English
Hey - I've found 7 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="apps/core/state/src/settings.rs" line_range="62" />
<code_context>
pub theme: ThemeChoice,
+ /// The language of the launcher interface.
+ #[serde(default)]
+ pub launcher_language: LauncherLanguage,
/// The initial Minecraft language, with an empty value following the launcher.
#[serde(default)]
</code_context>
<issue_to_address>
**Unsupported language resets settings**
When the settings file contains an unsupported `launcher_language` value, such as after a newer build adds a locale or the value is edited manually, `serde(default)` handles a missing field, not an unrecognized enum value, so deserializing `SettingsData` fails and the settings loader quarantines the entire file and uses defaults. The user loses the other settings until they restore the quarantined file.
Deserialize unknown language values to the default while keeping the rest of the settings document readable.
</issue_to_address>
### Comment 2
<location path="apps/frontend/src/panel/language.rs" line_range="108" />
<code_context>
+ data.launcher_language = selected
+ }) {
+ Ok(_) => {
+ settings.launcher_language = selected;
+ self.origin = Some(SettingsOrigin::Stored);
+ self.environment.clear_feedback();
</code_context>
<issue_to_address>
**Concurrent settings remain stale in memory**
When another launcher process changes a setting such as `default_game_language` after this window loads settings but before it changes the launcher language, `update_settings` returns the complete settings document read under the lock, but this branch discards it and updates only `launcher_language` in the window’s cached settings. A different launcher process’s concurrent game-language change therefore remains on disk but is absent from this window’s launch settings, so launching can use the wrong Minecraft language until reload.
Use the `SettingsData` returned by `update_settings` to refresh the cached settings and any dependent UI state after the write.
</issue_to_address>
### Comment 3
<location path="apps/core/state/src/settings.rs" line_range="61-62" />
<code_context>
memory: MemoryAllocation,
#[serde(default)]
pub theme: ThemeChoice,
+ /// The language of the launcher interface.
+ #[serde(default)]
+ pub launcher_language: LauncherLanguage,
/// The initial Minecraft language, with an empty value following the launcher.
#[serde(default)]
</code_context>
<issue_to_address>
**Older settings silently remain accepted**
When a saved settings document lacks `launcher_language`, `SettingsData` deserialization supplies `English` when an existing settings document lacks `launcher_language`, so the older document is still accepted as schema version 1 instead of being rejected as incompatible.
Do not use a serde default to accept documents that lack the new field; reject them according to the repository's schema policy.
</issue_to_address>
### Comment 4
<location path="apps/frontend/src/panel/accounts/third_party.rs" line_range="141" />
<code_context>
v_flex()
.gap_2()
- .child(Label::new("Choose a Minecraft profile"))
+ .child(Label::new(tr(cx, "accounts.third-party.choose-profile")))
.child(h_flex().gap_2().flex_wrap().children(buttons))
.into_any_element()
</code_context>
<issue_to_address>
**Chinese UI retains English controls**
When the launcher is set to Simplified Chinese and a user opens third-party sign-in, an account list, or instance memory controls, the catalog-backed labels switch, but `Form::render` still displays English sign-in statuses and field labels, while the account list and instance-memory controls also retain English text. Users who switch to Chinese see a mixed-language interface in these workflows.
Move the remaining user-visible strings and accessibility labels in these workflows into both catalogs and render them through the translation lookup.
Also at `apps/frontend/src/panel/accounts/render.rs:248`, `apps/frontend/src/panel/instances/instance_row.rs:240`.
</issue_to_address>
### Comment 5
<location path="apps/frontend/src/panel/instances/actions.rs" line_range="283" />
<code_context>
+ let message = format!(
+ "{} ({version}): {}",
+ directory.display(),
+ launch.message(cx)
+ );
match launch {
</code_context>
<issue_to_address>
**Recorded launch text stays stale**
When a launch entry is recorded before the user switches languages, `launch.message(cx)` is formatted into a `String` and retained by `ActivityLog`, so existing rows keep the old language while the rest of the panel updates.
Store launch activity in a form that can be translated again when each row is rendered.
Also at `apps/frontend/src/panel/instances/actions.rs:284`.
</issue_to_address>
### Comment 6
<location path="apps/frontend/src/panel/java/memory.rs" line_range="58-59" />
<code_context>
let view = cx.weak_entity();
let saved = settings.memory().manual_heap();
open_editor(
- "Minecraft memory".into(),
- "Automatic",
+ tr(cx, "settings.memory.title").into(),
+ tr(cx, "settings.memory.automatic"),
</code_context>
<issue_to_address>
**Open memory dialog keeps old language**
When the launcher language is switched while the global memory editor dialog is open, `open_editor` captures the localized title and inherited-mode label when the dialog opens, so switching languages while it is open rerenders the dialog with those strings frozen in the previous language while other labels update.
Store translation keys in the dialog/editor and resolve them during each render, including the dialog title.
</issue_to_address>
### Comment 7
<location path="apps/frontend/src/panel/accounts/render.rs" line_range="236-238" />
<code_context>
- .label("Use account")
+ .label(tr(cx, "accounts.use"))
.accessibility_label(format!(
"Use {} {} account",
account.name(),
- account_kind(id)
+ account_kind(id, cx)
))
.disabled(disabled || selected)
</code_context>
<issue_to_address>
**Account actions remain English**
When the launcher is set to Simplified Chinese and an account row is available, the accessibility-label templates stay hardcoded in English while only the interpolated account kind is translated, so screen-reader users hear mixed-language account actions after switching the launcher to Chinese.
Add localized accessibility-label templates to both catalogs and interpolate the account name and kind into them.
Also at `apps/frontend/src/panel/accounts/render.rs:250-253`.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 6 findings to address first, and the chosen launcher language is saved in settings and, when no game language is explicitly configured, also determines the language used for Minecraft launches. Reverting the code would not remove the saved preference or undo any game-language setting Minecraft has already stored, but the effect is bounded and can be corrected by changing the language settings.
Blocking findings: apps/core/state/src/settings.rs:62, apps/frontend/src/panel/language.rs:108, apps/frontend/src/panel/accounts/third_party.rs:141, apps/frontend/src/panel/instances/actions.rs:283, apps/frontend/src/panel/java/memory.rs:59, and 1 more
| pub theme: ThemeChoice, | ||
| /// The language of the launcher interface. | ||
| #[serde(default)] | ||
| pub launcher_language: LauncherLanguage, |
There was a problem hiding this comment.
🟡 中 · 不支持的语言会重置设置
当设置文件包含不受支持的 launcher_language 值时(例如新版添加了某种语言,或该值被手动编辑),serde(default) 只会处理字段缺失的情况,不会处理无法识别的枚举值,因此反序列化 SettingsData 会失败,设置加载器会隔离整个文件并使用默认设置。用户会丢失其他设置,直到恢复被隔离的文件。
将未知语言值反序列化为默认值,同时确保设置文档的其余部分仍可读取。
面向 AI 代理的提示
在 `apps/core/state/src/settings.rs` 第 62 行:
**不支持的语言会重置设置**
当设置文件包含不受支持的 `launcher_language` 值时(例如新版添加了某种语言,或该值被手动编辑),`serde(default)` 只会处理字段缺失的情况,不会处理无法识别的枚举值,因此反序列化 `SettingsData` 会失败,设置加载器会隔离整个文件并使用默认设置。用户会丢失其他设置,直到恢复被隔离的文件。
将未知语言值反序列化为默认值,同时确保设置文档的其余部分仍可读取。Original comment in English
🟡 Medium · Unsupported language resets settings
When the settings file contains an unsupported launcher_language value, such as after a newer build adds a locale or the value is edited manually, serde(default) handles a missing field, not an unrecognized enum value, so deserializing SettingsData fails and the settings loader quarantines the entire file and uses defaults. The user loses the other settings until they restore the quarantined file.
Deserialize unknown language values to the default while keeping the rest of the settings document readable.
Prompt for AI agents
In `apps/core/state/src/settings.rs` at line 62:
**Unsupported language resets settings**
When the settings file contains an unsupported `launcher_language` value, such as after a newer build adds a locale or the value is edited manually, `serde(default)` handles a missing field, not an unrecognized enum value, so deserializing `SettingsData` fails and the settings loader quarantines the entire file and uses defaults. The user loses the other settings until they restore the quarantined file.
Deserialize unknown language values to the default while keeping the rest of the settings document readable.| data.launcher_language = selected | ||
| }) { | ||
| Ok(_) => { | ||
| settings.launcher_language = selected; |
There was a problem hiding this comment.
🟡 中 · 并发修改的设置在内存中仍是旧值
当另一个启动器进程在此窗口加载设置之后、但在此窗口更改启动器语言之前,修改了诸如 default_game_language 这样的设置时,update_settings 会返回在锁内读取的完整设置文档,但此分支丢弃了该文档,只更新此窗口缓存设置中的 launcher_language。因此,另一个启动器进程并发修改的游戏语言虽然已写入磁盘,却没有反映在此窗口的启动设置中;在重新加载之前,启动时可能会使用错误的 Minecraft 语言。
使用 update_settings 返回的 SettingsData 刷新缓存的设置,并在写入后更新所有依赖的 UI 状态。
面向 AI 代理的提示
在 `apps/frontend/src/panel/language.rs` 第 108 行:
**并发修改的设置在内存中仍是旧值**
当另一个启动器进程在此窗口加载设置之后、但在此窗口更改启动器语言之前,修改了诸如 `default_game_language` 这样的设置时,`update_settings` 会返回在锁内读取的完整设置文档,但此分支丢弃了该文档,只更新此窗口缓存设置中的 `launcher_language`。因此,另一个启动器进程并发修改的游戏语言虽然已写入磁盘,却没有反映在此窗口的启动设置中;在重新加载之前,启动时可能会使用错误的 Minecraft 语言。
使用 `update_settings` 返回的 `SettingsData` 刷新缓存的设置,并在写入后更新所有依赖的 UI 状态。Original comment in English
🟡 Medium · Concurrent settings remain stale in memory
When another launcher process changes a setting such as default_game_language after this window loads settings but before it changes the launcher language, update_settings returns the complete settings document read under the lock, but this branch discards it and updates only launcher_language in the window’s cached settings. A different launcher process’s concurrent game-language change therefore remains on disk but is absent from this window’s launch settings, so launching can use the wrong Minecraft language until reload.
Use the SettingsData returned by update_settings to refresh the cached settings and any dependent UI state after the write.
Prompt for AI agents
In `apps/frontend/src/panel/language.rs` at line 108:
**Concurrent settings remain stale in memory**
When another launcher process changes a setting such as `default_game_language` after this window loads settings but before it changes the launcher language, `update_settings` returns the complete settings document read under the lock, but this branch discards it and updates only `launcher_language` in the window’s cached settings. A different launcher process’s concurrent game-language change therefore remains on disk but is absent from this window’s launch settings, so launching can use the wrong Minecraft language until reload.
Use the `SettingsData` returned by `update_settings` to refresh the cached settings and any dependent UI state after the write.| #[serde(default)] | ||
| pub launcher_language: LauncherLanguage, |
There was a problem hiding this comment.
⚪ 低 · 旧版设置仍会被静默接受
当已保存的设置文档缺少 launcher_language 时,若现有设置文档没有该字段,SettingsData 反序列化会将其设为 English,因此旧版文档仍会被当作架构版本 1 接受,而不是被判定为不兼容并拒绝。
不要使用 serde 默认值来接受缺少新字段的文档;应根据仓库的架构策略拒绝这些文档。
面向 AI 代理的提示
在 `apps/core/state/src/settings.rs` 第 61-62 行:
**旧版设置仍会被静默接受**
当已保存的设置文档缺少 `launcher_language` 时,若现有设置文档没有该字段,`SettingsData` 反序列化会将其设为 `English`,因此旧版文档仍会被当作架构版本 1 接受,而不是被判定为不兼容并拒绝。
不要使用 serde 默认值来接受缺少新字段的文档;应根据仓库的架构策略拒绝这些文档。摘自 AGENTS.md L65-66:
1. **No backward compatibility.** Delete what is obsolete. Do not add a
compatibility layer, a migration script or a fallback path.Original comment in English
⚪ Low · Older settings silently remain accepted
When a saved settings document lacks launcher_language, SettingsData deserialization supplies English when an existing settings document lacks launcher_language, so the older document is still accepted as schema version 1 instead of being rejected as incompatible.
Do not use a serde default to accept documents that lack the new field; reject them according to the repository's schema policy.
Prompt for AI agents
In `apps/core/state/src/settings.rs` at lines 61-62:
**Older settings silently remain accepted**
When a saved settings document lacks `launcher_language`, `SettingsData` deserialization supplies `English` when an existing settings document lacks `launcher_language`, so the older document is still accepted as schema version 1 instead of being rejected as incompatible.
Do not use a serde default to accept documents that lack the new field; reject them according to the repository's schema policy.From AGENTS.md L65-66:
1. **No backward compatibility.** Delete what is obsolete. Do not add a
compatibility layer, a migration script or a fallback path.| v_flex() | ||
| .gap_2() | ||
| .child(Label::new("Choose a Minecraft profile")) | ||
| .child(Label::new(tr(cx, "accounts.third-party.choose-profile"))) |
There was a problem hiding this comment.
🟡 中 · 中文界面仍有英文控件
当启动器设置为简体中文,用户打开第三方登录、账户列表或实例内存控件时,来自翻译目录的标签会切换语言,但 Form::render 仍显示英文的登录状态和字段标签,账户列表和实例内存控件也仍保留英文。切换到中文的用户在这些操作流程中会看到中英文混杂的界面。
将这些操作流程中剩余的用户可见字符串和无障碍标签加入两个翻译目录,并通过翻译查询来呈现。
另见 apps/frontend/src/panel/accounts/render.rs:248、apps/frontend/src/panel/instances/instance_row.rs:240。
面向 AI 代理的提示
在 `apps/frontend/src/panel/accounts/third_party.rs` 第 141 行:
**中文界面仍有英文控件**
当启动器设置为简体中文,用户打开第三方登录、账户列表或实例内存控件时,来自翻译目录的标签会切换语言,但 `Form::render` 仍显示英文的登录状态和字段标签,账户列表和实例内存控件也仍保留英文。切换到中文的用户在这些操作流程中会看到中英文混杂的界面。
将这些操作流程中剩余的用户可见字符串和无障碍标签加入两个翻译目录,并通过翻译查询来呈现。
另见 `apps/frontend/src/panel/accounts/render.rs:248`、`apps/frontend/src/panel/instances/instance_row.rs:240`。Original comment in English
🟡 Medium · Chinese UI retains English controls
When the launcher is set to Simplified Chinese and a user opens third-party sign-in, an account list, or instance memory controls, the catalog-backed labels switch, but Form::render still displays English sign-in statuses and field labels, while the account list and instance-memory controls also retain English text. Users who switch to Chinese see a mixed-language interface in these workflows.
Move the remaining user-visible strings and accessibility labels in these workflows into both catalogs and render them through the translation lookup.
Also at apps/frontend/src/panel/accounts/render.rs:248, apps/frontend/src/panel/instances/instance_row.rs:240.
Prompt for AI agents
In `apps/frontend/src/panel/accounts/third_party.rs` at line 141:
**Chinese UI retains English controls**
When the launcher is set to Simplified Chinese and a user opens third-party sign-in, an account list, or instance memory controls, the catalog-backed labels switch, but `Form::render` still displays English sign-in statuses and field labels, while the account list and instance-memory controls also retain English text. Users who switch to Chinese see a mixed-language interface in these workflows.
Move the remaining user-visible strings and accessibility labels in these workflows into both catalogs and render them through the translation lookup.
Also at `apps/frontend/src/panel/accounts/render.rs:248`, `apps/frontend/src/panel/instances/instance_row.rs:240`.| let message = format!( | ||
| "{} ({version}): {}", | ||
| directory.display(), | ||
| launch.message(cx) |
There was a problem hiding this comment.
🟡 中 · 已记录的启动文本仍显示旧语言
当用户切换语言之前记录了一条启动记录时,launch.message(cx) 会被格式化为 String 并由 ActivityLog 保留,因此其余面板更新后,已有条目仍会显示旧语言。
以可在每行渲染时重新翻译的形式存储启动活动记录。
另见 apps/frontend/src/panel/instances/actions.rs:284。
面向 AI 代理的提示
在 `apps/frontend/src/panel/instances/actions.rs` 第 283 行:
**已记录的启动文本仍显示旧语言**
当用户切换语言之前记录了一条启动记录时,`launch.message(cx)` 会被格式化为 `String` 并由 `ActivityLog` 保留,因此其余面板更新后,已有条目仍会显示旧语言。
以可在每行渲染时重新翻译的形式存储启动活动记录。
另见 `apps/frontend/src/panel/instances/actions.rs:284`。Original comment in English
🟡 Medium · Recorded launch text stays stale
When a launch entry is recorded before the user switches languages, launch.message(cx) is formatted into a String and retained by ActivityLog, so existing rows keep the old language while the rest of the panel updates.
Store launch activity in a form that can be translated again when each row is rendered.
Also at apps/frontend/src/panel/instances/actions.rs:284.
Prompt for AI agents
In `apps/frontend/src/panel/instances/actions.rs` at line 283:
**Recorded launch text stays stale**
When a launch entry is recorded before the user switches languages, `launch.message(cx)` is formatted into a `String` and retained by `ActivityLog`, so existing rows keep the old language while the rest of the panel updates.
Store launch activity in a form that can be translated again when each row is rendered.
Also at `apps/frontend/src/panel/instances/actions.rs:284`.| "Minecraft memory".into(), | ||
| "Automatic", |
There was a problem hiding this comment.
🟡 中 · 已打开的内存对话框仍使用旧语言
当全局内存编辑器对话框打开时切换启动器语言,open_editor 会在对话框打开时捕获本地化标题和继承模式标签。因此,在对话框打开期间切换语言会重新渲染对话框,但这些字符串仍固定为先前的语言,而其他标签则会更新。
在对话框/编辑器中存储翻译键,并在每次渲染时解析,包括对话框标题。
面向 AI 代理的提示
在 `apps/frontend/src/panel/java/memory.rs` 第 58-59 行:
**已打开的内存对话框仍使用旧语言**
当全局内存编辑器对话框打开时切换启动器语言,`open_editor` 会在对话框打开时捕获本地化标题和继承模式标签。因此,在对话框打开期间切换语言会重新渲染对话框,但这些字符串仍固定为先前的语言,而其他标签则会更新。
在对话框/编辑器中存储翻译键,并在每次渲染时解析,包括对话框标题。Original comment in English
🟡 Medium · Open memory dialog keeps old language
When the launcher language is switched while the global memory editor dialog is open, open_editor captures the localized title and inherited-mode label when the dialog opens, so switching languages while it is open rerenders the dialog with those strings frozen in the previous language while other labels update.
Store translation keys in the dialog/editor and resolve them during each render, including the dialog title.
Prompt for AI agents
In `apps/frontend/src/panel/java/memory.rs` at lines 58-59:
**Open memory dialog keeps old language**
When the launcher language is switched while the global memory editor dialog is open, `open_editor` captures the localized title and inherited-mode label when the dialog opens, so switching languages while it is open rerenders the dialog with those strings frozen in the previous language while other labels update.
Store translation keys in the dialog/editor and resolve them during each render, including the dialog title.| "Use {} {} account", | ||
| account.name(), | ||
| account_kind(id) | ||
| account_kind(id, cx) |
There was a problem hiding this comment.
🟡 中 · 账户操作仍为英文
当启动器设置为简体中文且账户行可用时,无障碍标签模板仍硬编码为英文,只有插入的账户类型经过了翻译。因此,启动器切换为中文后,屏幕阅读器用户听到的账户操作描述会中英文混杂。
在两个翻译目录中添加本地化的无障碍标签模板,并将账户名称和类型插入其中。
另见 apps/frontend/src/panel/accounts/render.rs:250-253。
面向 AI 代理的提示
在 `apps/frontend/src/panel/accounts/render.rs` 第 236-238 行:
**账户操作仍为英文**
当启动器设置为简体中文且账户行可用时,无障碍标签模板仍硬编码为英文,只有插入的账户类型经过了翻译。因此,启动器切换为中文后,屏幕阅读器用户听到的账户操作描述会中英文混杂。
在两个翻译目录中添加本地化的无障碍标签模板,并将账户名称和类型插入其中。
另见 `apps/frontend/src/panel/accounts/render.rs:250-253`。Original comment in English
🟡 Medium · Account actions remain English
When the launcher is set to Simplified Chinese and an account row is available, the accessibility-label templates stay hardcoded in English while only the interpolated account kind is translated, so screen-reader users hear mixed-language account actions after switching the launcher to Chinese.
Add localized accessibility-label templates to both catalogs and interpolate the account name and kind into them.
Also at apps/frontend/src/panel/accounts/render.rs:250-253.
Prompt for AI agents
In `apps/frontend/src/panel/accounts/render.rs` at lines 236-238:
**Account actions remain English**
When the launcher is set to Simplified Chinese and an account row is available, the accessibility-label templates stay hardcoded in English while only the interpolated account kind is translated, so screen-reader users hear mixed-language account actions after switching the launcher to Chinese.
Add localized accessibility-label templates to both catalogs and interpolate the account name and kind into them.
Also at `apps/frontend/src/panel/accounts/render.rs:250-253`.
Summary
Verification
cargo test --workspace --locked: 557 passed, 7 ignored.cargo-nextestwas unavailable.Some lower-level diagnostics and debug text remain in English.
Sourcery 总结
在整个桌面启动器中支持实时切换英语和简体中文,同时保留独立的游戏语言偏好设置和未保存的界面状态。
新功能:
增强功能:
文档:
测试:
杂项:
Original summary in English
Sourcery 摘要
支持在桌面启动器中实时切换英语和简体中文,同时保留独立的游戏语言设置和未保存的界面状态。
新功能:
增强:
文档:
测试:
杂项:
Original summary in English
Sourcery 总结
在桌面启动器中启用英语和简体中文的实时切换,同时保留独立的游戏语言设置和未保存的界面状态。
新功能:
错误修复:
改进:
文档:
测试:
杂项:
Original summary in English
Summary by Sourcery
Enable live English and Simplified Chinese switching across the desktop launcher while preserving independent game-language settings and unsaved UI state.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: