Replace verbose map-based translation calls with concise grammar
engine helpers across all command packages:
- i18n.T("common.label.xxx") → i18n.Label("xxx")
- i18n.T("common.error.failed", map) → i18n.T("i18n.fail.verb", subj)
- i18n.T("common.progress.running", map) → i18n.ProgressSubject()
- i18n.T("common.count.xxx", map) → i18n.T("i18n.count.xxx", n)
Packages updated: ai, ci, dev, docs, php, pkgcmd, sdk, setup, test, vm
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
581 B
Go
25 lines
581 B
Go
package ci
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/host-uk/core/pkg/i18n"
|
|
"github.com/host-uk/core/pkg/release"
|
|
)
|
|
|
|
// runCIReleaseVersion shows the determined version.
|
|
func runCIReleaseVersion() error {
|
|
projectDir, err := os.Getwd()
|
|
if err != nil {
|
|
return fmt.Errorf("%s: %w", i18n.T("i18n.fail.get", "working directory"), err)
|
|
}
|
|
|
|
version, err := release.DetermineVersion(projectDir)
|
|
if err != nil {
|
|
return fmt.Errorf("%s: %w", i18n.T("i18n.fail.determine", "version"), err)
|
|
}
|
|
|
|
fmt.Printf("%s %s\n", i18n.Label("version"), releaseValueStyle.Render(version))
|
|
return nil
|
|
}
|