fix(i18n): 命令组级 Short 描述接入 i18n 并修复 ignore 组 help 泄漏原始键 cmd.ignore.short
This commit is contained in:
parent
47cc2c2888
commit
0135cf36e0
|
|
@ -17,6 +17,7 @@
|
|||
"cmd.ci.short": "CI/CD operations",
|
||||
"cmd.ci.stop.short": "Stop a build",
|
||||
"cmd.compare.files.short": "List changed files between two refs",
|
||||
"cmd.compare.short": "Compare branches, tags, or commits",
|
||||
"cmd.compare.view.short": "Compare two branches, tags, or commits",
|
||||
"cmd.config.get.short": "Get a configuration value",
|
||||
"cmd.config.init.short": "Initialize configuration file",
|
||||
|
|
@ -37,7 +38,9 @@
|
|||
"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.health.fetch.short": "Fetch PR and Issue data into SQLite for health analysis",
|
||||
"cmd.health.short": "Project health data collection",
|
||||
"cmd.ignore.list.short": "List available ignore-file templates",
|
||||
"cmd.ignore.short": "Ignore file 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",
|
||||
|
|
@ -54,8 +57,10 @@
|
|||
"cmd.label.create.short": "Create an issue label",
|
||||
"cmd.label.delete.short": "Delete an issue label",
|
||||
"cmd.label.list.short": "List issue labels",
|
||||
"cmd.label.short": "Issue label operations",
|
||||
"cmd.label.update.short": "Update an issue label while preserving unspecified fields",
|
||||
"cmd.license.list.short": "List available licenses",
|
||||
"cmd.license.short": "License operations",
|
||||
"cmd.member.accept-invite.short": "Accept a repository invite link",
|
||||
"cmd.member.add.short": "Add a repository member by user ID",
|
||||
"cmd.member.batch-add.short": "Add multiple repository members by user IDs or a CSV file",
|
||||
|
|
@ -64,11 +69,13 @@
|
|||
"cmd.member.list.short": "List repository members",
|
||||
"cmd.member.remove.short": "Remove a repository member by user ID",
|
||||
"cmd.member.role.short": "Change a repository member role",
|
||||
"cmd.member.short": "Repository member operations",
|
||||
"cmd.milestone.close.short": "Close a milestone",
|
||||
"cmd.milestone.create.short": "Create a milestone",
|
||||
"cmd.milestone.delete.short": "Delete a milestone",
|
||||
"cmd.milestone.list.short": "List milestones",
|
||||
"cmd.milestone.reopen.short": "Reopen a milestone",
|
||||
"cmd.milestone.short": "Milestone operations",
|
||||
"cmd.milestone.update.short": "Update a milestone",
|
||||
"cmd.milestone.view.short": "View milestone details and linked issues",
|
||||
"cmd.org.create.short": "Create an organization",
|
||||
|
|
@ -85,6 +92,7 @@
|
|||
"cmd.pipeline.run.short": "Run a pipeline workflow",
|
||||
"cmd.pipeline.runs.short": "List pipeline run records",
|
||||
"cmd.pipeline.save-yaml.short": "Save a visual pipeline YAML graph",
|
||||
"cmd.pipeline.short": "Pipeline operations",
|
||||
"cmd.pipeline.view.short": "Show pipeline details",
|
||||
"cmd.pr.close.short": "Close a pull request",
|
||||
"cmd.pr.comment.short": "Add a comment to a pull request",
|
||||
|
|
@ -142,11 +150,13 @@
|
|||
"cmd.wiki.create.short": "Create a new wiki page",
|
||||
"cmd.wiki.delete.short": "Delete a wiki page",
|
||||
"cmd.wiki.list.short": "List wiki pages",
|
||||
"cmd.wiki.short": "Wiki page management",
|
||||
"cmd.wiki.update.short": "Update an existing wiki page",
|
||||
"cmd.wiki.view.short": "View a wiki page by page name",
|
||||
"cmd.workflow.health.short": "Score repository health with local workflow rules",
|
||||
"cmd.workflow.pr-summary.short": "Generate a read-only pull request review summary",
|
||||
"cmd.workflow.repo-report.short": "Generate a read-only repository workflow report",
|
||||
"cmd.workflow.short": "AI agent workflow analysis",
|
||||
"cmd.workflow.triage.short": "Analyze issues with local workflow triage rules",
|
||||
"error.auth.delete_token_failed": "failed to delete token: {message}",
|
||||
"error.auth.login_failed": "login failed: {message}",
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
"cmd.ci.short": "CI/CD 操作",
|
||||
"cmd.ci.stop.short": "停止构建",
|
||||
"cmd.compare.files.short": "列出两个引用之间变更的文件",
|
||||
"cmd.compare.short": "比较分支、标签或提交",
|
||||
"cmd.compare.view.short": "比较两个分支、标签或提交",
|
||||
"cmd.config.get.short": "获取配置项",
|
||||
"cmd.config.init.short": "初始化配置文件",
|
||||
|
|
@ -37,7 +38,9 @@
|
|||
"cmd.doctor.long": "诊断 gitlink-cli 的配置、认证、仓库上下文和 API 连通性问题。",
|
||||
"cmd.doctor.short": "诊断 gitlink-cli 环境问题",
|
||||
"cmd.health.fetch.short": "抓取 PR 与 Issue 数据到 SQLite 用于健康度分析",
|
||||
"cmd.health.short": "项目健康数据采集",
|
||||
"cmd.ignore.list.short": "列出可用的 ignore 文件模板",
|
||||
"cmd.ignore.short": "忽略文件模板操作",
|
||||
"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",
|
||||
|
|
@ -54,8 +57,10 @@
|
|||
"cmd.label.create.short": "创建 issue 标签",
|
||||
"cmd.label.delete.short": "删除 issue 标签",
|
||||
"cmd.label.list.short": "列出 issue 标签",
|
||||
"cmd.label.short": "Issue 标签操作",
|
||||
"cmd.label.update.short": "更新 issue 标签(未指定字段保持不变)",
|
||||
"cmd.license.list.short": "列出可用的开源许可证",
|
||||
"cmd.license.short": "许可证操作",
|
||||
"cmd.member.accept-invite.short": "接受仓库邀请链接",
|
||||
"cmd.member.add.short": "按用户 ID 添加仓库成员",
|
||||
"cmd.member.batch-add.short": "按用户 ID 列表或 CSV 文件批量添加仓库成员",
|
||||
|
|
@ -64,11 +69,13 @@
|
|||
"cmd.member.list.short": "列出仓库成员",
|
||||
"cmd.member.remove.short": "按用户 ID 移除仓库成员",
|
||||
"cmd.member.role.short": "变更仓库成员角色",
|
||||
"cmd.member.short": "仓库成员操作",
|
||||
"cmd.milestone.close.short": "关闭里程碑",
|
||||
"cmd.milestone.create.short": "创建里程碑",
|
||||
"cmd.milestone.delete.short": "删除里程碑",
|
||||
"cmd.milestone.list.short": "列出里程碑",
|
||||
"cmd.milestone.reopen.short": "重新打开里程碑",
|
||||
"cmd.milestone.short": "里程碑操作",
|
||||
"cmd.milestone.update.short": "更新里程碑",
|
||||
"cmd.milestone.view.short": "查看里程碑详情及关联 issue",
|
||||
"cmd.org.create.short": "创建组织",
|
||||
|
|
@ -85,6 +92,7 @@
|
|||
"cmd.pipeline.run.short": "运行流水线工作流",
|
||||
"cmd.pipeline.runs.short": "列出流水线运行记录",
|
||||
"cmd.pipeline.save-yaml.short": "保存可视化流水线 YAML 图",
|
||||
"cmd.pipeline.short": "流水线操作",
|
||||
"cmd.pipeline.view.short": "查看流水线详情",
|
||||
"cmd.pr.close.short": "关闭拉取请求",
|
||||
"cmd.pr.comment.short": "给拉取请求添加评论",
|
||||
|
|
@ -142,11 +150,13 @@
|
|||
"cmd.wiki.create.short": "创建 wiki 页面",
|
||||
"cmd.wiki.delete.short": "删除 wiki 页面",
|
||||
"cmd.wiki.list.short": "列出 wiki 页面",
|
||||
"cmd.wiki.short": "Wiki 页面管理",
|
||||
"cmd.wiki.update.short": "更新已有 wiki 页面",
|
||||
"cmd.wiki.view.short": "按页面名查看 wiki 页面",
|
||||
"cmd.workflow.health.short": "用本地工作流规则为仓库健康度打分",
|
||||
"cmd.workflow.pr-summary.short": "生成只读的 PR 评审摘要",
|
||||
"cmd.workflow.repo-report.short": "生成只读的仓库工作流报告",
|
||||
"cmd.workflow.short": "AI 智能体工作流分析",
|
||||
"cmd.workflow.triage.short": "用本地工作流分诊规则分析 issue",
|
||||
"error.auth.delete_token_failed": "删除 Token 失败:{message}",
|
||||
"error.auth.login_failed": "登录失败:{message}",
|
||||
|
|
|
|||
|
|
@ -63,11 +63,11 @@ func RegisterAll(root *cobra.Command, translators ...*i18n.Translator) {
|
|||
descriptions := map[string]string{
|
||||
"repo": tr.T("cmd.repo.short"),
|
||||
"issue": tr.T("cmd.issue.short"),
|
||||
"label": "Issue label operations",
|
||||
"license": "License operations",
|
||||
"member": "Repository member operations",
|
||||
"milestone": "Milestone operations",
|
||||
"pipeline": "Pipeline operations",
|
||||
"label": tr.T("cmd.label.short"),
|
||||
"license": tr.T("cmd.license.short"),
|
||||
"member": tr.T("cmd.member.short"),
|
||||
"milestone": tr.T("cmd.milestone.short"),
|
||||
"pipeline": tr.T("cmd.pipeline.short"),
|
||||
"pr": tr.T("cmd.pr.short"),
|
||||
"profile": tr.T("cmd.profile.short"),
|
||||
"release": tr.T("cmd.release.short"),
|
||||
|
|
@ -76,13 +76,13 @@ func RegisterAll(root *cobra.Command, translators ...*i18n.Translator) {
|
|||
"user": tr.T("cmd.user.short"),
|
||||
"search": tr.T("cmd.search.short"),
|
||||
"ci": tr.T("cmd.ci.short"),
|
||||
"compare": "Compare branches, tags, or commits",
|
||||
"compare": tr.T("cmd.compare.short"),
|
||||
"dataset": tr.T("cmd.dataset.short"),
|
||||
"webhook": tr.T("cmd.webhook.short"),
|
||||
"wiki": "Wiki page management",
|
||||
"health": "Project health data collection",
|
||||
"wiki": tr.T("cmd.wiki.short"),
|
||||
"health": tr.T("cmd.health.short"),
|
||||
"ignore": tr.T("cmd.ignore.short"),
|
||||
"workflow": "AI agent workflow analysis",
|
||||
"workflow": tr.T("cmd.workflow.short"),
|
||||
}
|
||||
|
||||
for name, shortcuts := range groups {
|
||||
|
|
|
|||
|
|
@ -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.") {
|
||||
t.Fatalf("Short description leaks raw i18n key: %q", cmd.Short)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue