fix(i18n): add missing cmd.ignore.short group description key #364

Merged
wbtiger merged 1 commits from heke1228/gitlink-cli:fix/ignore-i18n-key into master 2026-07-14 20:40:59 +08:00
4 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,6 @@
# Ignore group i18n key
`register.go``tr.T("cmd.ignore.short")` 设置 `ignore` 组描述,但该键在两个语言包中都缺失,导致 `--help` 里直接显示字面量 `cmd.ignore.short`
- 补齐 `en-US.json` / `zh-CN.json``cmd.ignore.short`
- `TestRegisterAllGroupDescriptions` 增加断言:组描述不得是未解析的 i18n 键

View File

@ -34,6 +34,7 @@
"cmd.dataset.view.short": "View a repository's dataset",
"cmd.doctor.long": "Run local diagnostics for gitlink-cli configuration, authentication, repository context and API connectivity.",
"cmd.doctor.short": "Diagnose gitlink-cli environment problems",
"cmd.ignore.short": "Gitignore template operations",
"cmd.issue.batch_close.long": "Close filtered issues in bulk.\n\nThis command defaults to dry-run mode and only prints matching issues.\nPass --yes to execute remote close operations. Use restrictive filters and a small limit.\n\nExamples:\n gitlink-cli issue +batch-close --owner Gitlink --repo gitlink-cli --older-than-days 60 --limit 20\n gitlink-cli issue +batch-close --owner Gitlink --repo gitlink-cli --older-than-days 60 --limit 20 --yes",
"cmd.issue.batch_close.short": "Close filtered issues in bulk. Defaults to dry-run; pass --yes to execute.",
"cmd.issue.batch_label.long": "Add a label to filtered issues in bulk.\n\nThis command defaults to dry-run mode and only prints matching issues.\nPass --yes to execute remote label operations. The current implementation does not fake label writes when the API endpoint is unavailable.\n\nExamples:\n gitlink-cli issue +batch-label --owner Gitlink --repo gitlink-cli --add-label stale --older-than-days 30 --limit 50\n gitlink-cli issue +batch-label --owner Gitlink --repo gitlink-cli --add-label stale --older-than-days 30 --limit 50 --yes",

View File

@ -34,6 +34,7 @@
"cmd.dataset.view.short": "查看仓库数据集",
"cmd.doctor.long": "诊断 gitlink-cli 的配置、认证、仓库上下文和 API 连通性问题。",
"cmd.doctor.short": "诊断 gitlink-cli 环境问题",
"cmd.ignore.short": "Gitignore 模板操作",
"cmd.issue.batch_close.long": "批量关闭筛选后的议题。\n\n该命令默认处于 dry-run 模式,只打印匹配的议题。\n传入 --yes 后执行远端关闭操作。请使用严格筛选条件和较小 limit。\n\n示例\n gitlink-cli issue +batch-close --owner Gitlink --repo gitlink-cli --older-than-days 60 --limit 20\n gitlink-cli issue +batch-close --owner Gitlink --repo gitlink-cli --older-than-days 60 --limit 20 --yes",
"cmd.issue.batch_close.short": "批量关闭筛选后的议题。默认 dry-run传入 --yes 后执行。",
"cmd.issue.batch_label.long": "给筛选后的议题批量添加标签。\n\n该命令默认处于 dry-run 模式,只打印匹配的议题。\n传入 --yes 后执行远端标签操作。当前实现不会在 API 端点不可用时伪造写入结果。\n\n示例\n gitlink-cli issue +batch-label --owner Gitlink --repo gitlink-cli --add-label stale --older-than-days 30 --limit 50\n gitlink-cli issue +batch-label --owner Gitlink --repo gitlink-cli --add-label stale --older-than-days 30 --limit 50 --yes",

View File

@ -1,6 +1,7 @@
package shortcuts
import (
"strings"
"testing"
"github.com/spf13/cobra"
@ -60,6 +61,9 @@ func TestRegisterAllGroupDescriptions(t *testing.T) {
if cmd.Short == "" {
t.Fatal("Short description is empty")
}
if strings.HasPrefix(cmd.Short, "cmd.") && strings.HasSuffix(cmd.Short, ".short") {
t.Fatalf("Short description is an unresolved i18n key: %q", cmd.Short)
}
})
}
}