Skip to content

fix(localization): 删除无引用常量与孤儿资源键 - #910

Merged
AlianBlank merged 5 commits into
mainfrom
feature/auto-server-source-worker-run-12561-20261030T0310
Oct 30, 2026
Merged

AlianBlank merged 5 commits into
mainfrom
feature/auto-server-source-worker-run-12561-20261030T0310

Conversation

@AlianBlank

@AlianBlank AlianBlank commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes GFX-1159
Closes #905

Summary by CodeRabbit

  • 变更说明
    • 更新本地化资源清理记录,并调整资源键集合校验门禁。
    • 移除了多类旧消息资源及对应的公开键常量,涵盖日志、网络、启动、异常和工具等内容;依赖这些常量的外部 NuGet 项目可能需要修改代码才能通过编译。
    • 部分中文资源新增了参数校验、设置加载和健康检查相关文案。

移除引用不存在的 Resources\Resources.Designer.cs 的
Compile Update 与目录已有实体内容时无效的 Localization\
Folder 项(resx 模板时代残留);强类型资源访问走 Keys.*
常量,构建产物嵌入资源名与 zh-CN 卫星程序集不变。

Linear: GFX-1159
extra_keys 分支由仅打印改为默认非零退出,防止常量与 resx
键集合再漂移;新增 --fix 显式放行并自动补齐缺失键(默认
模式只读不写盘),放行时输出区分性文案避免误报集合一致。

Linear: GFX-1159
清理键生命周期无闭环管理的存量垃圾(GFX-1159 / C425):
删除 100 个全仓零引用 public 常量(名+值双扫描确认)与
5 个随之清空的键类型(Keys.Logs、Keys.CodeGenerator 整文件
及 StartUp.ApplicationSettings 等三处空壳),同步删除两 resx
共 243 个孤儿/失效键条目(Extensions.* 18 键、
CoreExceptions.HotfixModule.* 9 键及随常量删除的 99 键×2),
auto_translate.py 翻译字典同步移除 53 条失效条目;清理后
常量值集合与两个 resx 键集合精确一致(633==633==633)。

BREAKING CHANGE: 被删 public 常量/键类型若被外部 NuGet
消费方直接引用将编译失败(仓内引用为零,同 C194 先例)。

Linear: GFX-1159
@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown

GFX-1159

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

此变更删除多个未引用的公开本地化键和旧资源条目,更新中英文资源及翻译映射,并清理项目配置。变更记录还描述了键集合校验规则和外部 NuGet 消费方的编译影响。

Changes: 本地化键清理

Layer / File(s) Summary
移除未引用的公开键声明
GameFrameX.Localization/Keys.*.cs
多个键类中的未引用常量及空壳类型已删除。启动配置相关的键也已移除,部分说明文字有所调整。
调整本地化资源与翻译映射
GameFrameX.Localization/Localization/Messages/Resources.resx、GameFrameX.Localization/Localization/Messages/Resources.zh-CN.resx、GameFrameX.Localization/auto_translate.py
资源文件删除多组旧条目,并新增部分诊断文案。翻译规则删除了对应的旧映射。
更新项目配置与变更记录
GameFrameX.Localization/GameFrameX.Localization.csproj、CHANGELOG.md
项目文件移除了资源设计器元数据和显式文件夹项。变更记录描述了清理范围、键集合校验事项及外部消费方的编译影响。

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

Merge Risk: Low · up to 875f8

The cleanup removes unused localization keys and resource entries. However, the key-set check still passes when extra resource keys remain, even though the PR says it now fails on them. Either implement the failure on extra keys or correct the changelog before relying on this gate. The removal of public constants is a documented breaking change for external consumers.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- check_keys.py 保留 main 的 C426 一致性门禁(调用点扫描/占位符比对)
- Keys/resx 保留本分支的无引用键删除;main 新增但无引用的键不回流
- 恢复 main 上被分支改坏的 11 个键值(占位符丢失会致 EN 运行时 FormatException)
- 本地化门禁 check_keys.py 全量通过(exit 0)
@sonarqubecloud

Copy link
Copy Markdown

@AlianBlank
AlianBlank merged commit da04225 into main Oct 30, 2026
3 of 4 checks passed
@AlianBlank
AlianBlank deleted the feature/auto-server-source-worker-run-12561-20261030T0310 branch October 30, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

清理本地化孤儿键、无引用常量、重复常量定义与 csproj 死配置

1 participant