fix(i18n): 修复 ignore 组帮助显示原始键名,9 个命令组简介补齐 i18n #424

Merged
wbtiger merged 1 commits from Taoyouce/gitlink-cli:fix/i18n-group-shorts into master 2026-07-14 20:35:00 +08:00
Contributor

问题

  1. 用户可见 buggitlink-cli --helpgitlink-cli ignore --help 中 ignore 组的简介直接显示原始键名 cmd.ignore.short——register.go 引用了该键但两个 locale 文件都没有定义
  2. shortcuts 注册表中另有 9 个命令组(label/license/member/milestone/pipeline/compare/wiki/health/workflow)简介硬编码英文,不走 i18n,中文环境下无法本地化

变更

  • en-US.json / zh-CN.json 补齐 10 个 cmd.<group>.short 键(含缺失的 ignore)
  • register.go 的 10 处硬编码/坏键全部改为 tr.T(...)

验证

  • 修复前:ignore --help 首行显示 cmd.ignore.short;修复后 en 显示 "Ignore file template operations",zh 显示「忽略文件模板操作」
  • GITLINK_LANG=zh-CN --help 实测 health/ignore/wiki 等组简介全部正确中文化
  • build/vet/test/gofmt 全绿;两 locale 键集合保持一致(269→279 对齐)
## 问题 1. **用户可见 bug**:`gitlink-cli --help` 与 `gitlink-cli ignore --help` 中 ignore 组的简介直接显示原始键名 `cmd.ignore.short`——register.go 引用了该键但两个 locale 文件都没有定义 2. shortcuts 注册表中另有 9 个命令组(label/license/member/milestone/pipeline/compare/wiki/health/workflow)简介硬编码英文,不走 i18n,中文环境下无法本地化 ## 变更 - en-US.json / zh-CN.json 补齐 10 个 `cmd.<group>.short` 键(含缺失的 ignore) - register.go 的 10 处硬编码/坏键全部改为 `tr.T(...)` ## 验证 - 修复前:`ignore --help` 首行显示 `cmd.ignore.short`;修复后 en 显示 "Ignore file template operations",zh 显示「忽略文件模板操作」 - `GITLINK_LANG=zh-CN --help` 实测 health/ignore/wiki 等组简介全部正确中文化 - build/vet/test/gofmt 全绿;两 locale 键集合保持一致(269→279 对齐)
Taoyouce added 6 commits 2026-07-11 02:13:54 +08:00
wbtiger merged commit 93ce268c68 into master 2026-07-14 20:35:00 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#424
No description provided.