From e8cdb31a9885d40c764b1142624efdbb07f3aae3 Mon Sep 17 00:00:00 2001 From: Snider Date: Fri, 30 Jan 2026 15:05:24 +0000 Subject: [PATCH] refactor(i18n): remove redundant P, PS, L shorthand functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are now redundant with the i18n.* namespace magic: - P("fetch") → T("i18n.progress.fetch") - PS("build", "x") → T("i18n.progress.build", "x") - L("status") → T("i18n.label.status") Co-Authored-By: Claude Opus 4.5 --- cmd/dev/dev_ci.go | 2 +- cmd/dev/dev_issues.go | 2 +- cmd/dev/dev_reviews.go | 2 +- pkg/i18n/i18n.go | 29 ----------------------------- 4 files changed, 3 insertions(+), 32 deletions(-) diff --git a/cmd/dev/dev_ci.go b/cmd/dev/dev_ci.go index 220168ed..266fa9b5 100644 --- a/cmd/dev/dev_ci.go +++ b/cmd/dev/dev_ci.go @@ -104,7 +104,7 @@ func runCI(registryPath string, branch string, failedOnly bool) error { repoList := reg.List() for i, repo := range repoList { repoFullName := fmt.Sprintf("%s/%s", reg.Org, repo.Name) - fmt.Printf("\033[2K\r%s %d/%d %s", dimStyle.Render(i18n.P("check")), i+1, len(repoList), repo.Name) + fmt.Printf("\033[2K\r%s %d/%d %s", dimStyle.Render(i18n.T("i18n.progress.check")), i+1, len(repoList), repo.Name) runs, err := fetchWorkflowRuns(repoFullName, repo.Name, branch) if err != nil { diff --git a/cmd/dev/dev_issues.go b/cmd/dev/dev_issues.go index fc0e2afd..df996bea 100644 --- a/cmd/dev/dev_issues.go +++ b/cmd/dev/dev_issues.go @@ -118,7 +118,7 @@ func runIssues(registryPath string, limit int, assignee string) error { repoList := reg.List() for i, repo := range repoList { repoFullName := fmt.Sprintf("%s/%s", reg.Org, repo.Name) - fmt.Printf("\033[2K\r%s %d/%d %s", dimStyle.Render(i18n.P("fetch")), i+1, len(repoList), repo.Name) + fmt.Printf("\033[2K\r%s %d/%d %s", dimStyle.Render(i18n.T("i18n.progress.fetch")), i+1, len(repoList), repo.Name) issues, err := fetchIssues(repoFullName, repo.Name, limit, assignee) if err != nil { diff --git a/cmd/dev/dev_reviews.go b/cmd/dev/dev_reviews.go index 38b80f85..2a938c16 100644 --- a/cmd/dev/dev_reviews.go +++ b/cmd/dev/dev_reviews.go @@ -115,7 +115,7 @@ func runReviews(registryPath string, author string, showAll bool) error { repoList := reg.List() for i, repo := range repoList { repoFullName := fmt.Sprintf("%s/%s", reg.Org, repo.Name) - fmt.Printf("\033[2K\r%s %d/%d %s", dimStyle.Render(i18n.P("fetch")), i+1, len(repoList), repo.Name) + fmt.Printf("\033[2K\r%s %d/%d %s", dimStyle.Render(i18n.T("i18n.progress.fetch")), i+1, len(repoList), repo.Name) prs, err := fetchPRs(repoFullName, repo.Name, author) if err != nil { diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 52707a6b..596fd828 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -106,35 +106,6 @@ func C(intent string, subject *Subject) *Composed { } } -// --- Grammar convenience functions (package-level) --- -// These provide direct access to grammar functions without needing a service instance. - -// P returns a progress message for a verb: "Building...", "Checking..." -// Use this instead of T("cli.progress.building") for dynamic progress messages. -// -// P("build") // "Building..." -// P("fetch") // "Fetching..." -func P(verb string) string { - return Progress(verb) -} - -// PS returns a progress message with a subject: "Building project...", "Checking config..." -// -// PS("build", "project") // "Building project..." -// PS("check", "config.yaml") // "Checking config.yaml..." -func PS(verb, subject string) string { - return ProgressSubject(verb, subject) -} - -// L returns a label with colon: "Status:", "Version:" -// Use this instead of T("common.label.status") for simple labels. -// -// L("status") // "Status:" -// L("version") // "Version:" -func L(word string) string { - return Label(word) -} - // _ is the raw gettext-style translation helper. // Unlike T(), this does NOT handle core.* namespace magic. // Use this for direct key lookups without auto-composition.