Upstream/i18n devwarn fix(i18n): localize and delay Dev Warning until language is loaded #3494
+11
−2
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.
变更动机
启动早期弹窗在语言脚本加载前显示,造成初次出现英文;需要本地化并延后到语言就绪后显示,避免“英文闪现”。
变更内容
src/gui.js(仅此文件)
对警示弹窗的标题与正文显式 localize(...)。
在 reflectLanguage() 设置语言后再触发 warnAboutDev();若目标语言非英文或字典未就绪则推迟展示。
范围控制
不包含任何新脚本或工具、文档或生成产物。
风险评估
低(仅影响启动阶段的弹窗显示时机与文案)。
测试说明
访问 snap.html#lang:zh_CN:启动后弹窗为中文且在语言加载后显示。
不加语言锚点时无异常;其它功能不受影响。
影响文件
M src/gui.js
参考说明
行为未变更,仅优化显示时机与本地化。