cli/cmd/ci/ci_version.go
Snider 6f6ee99008 refactor(i18n): consolidate 85 keys into reusable templates
Replace specific messages with parameterized templates:

- 60 "failed to X" errors -> common.error.failed + Action
- 10 "Running X" messages -> common.progress.running + Task
- 4 "Checking X" messages -> common.progress.checking + Item
- 13 "X successfully" messages -> common.success.completed + Action

This reduces translation maintenance - translators only need to
translate 3 templates instead of 85 individual messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:44:45 +00:00

25 lines
662 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("common.error.failed", map[string]any{"Action": "get working directory"}), err)
}
version, err := release.DetermineVersion(projectDir)
if err != nil {
return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "determine version"}), err)
}
fmt.Printf("%s %s\n", i18n.T("common.label.version"), releaseValueStyle.Render(version))
return nil
}