refactor(i18n): remove redundant P, PS, L shorthand functions
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 <noreply@anthropic.com>
This commit is contained in:
parent
fe2fe7b425
commit
e8cdb31a98
4 changed files with 3 additions and 32 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue