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>
25 lines
662 B
Go
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
|
|
}
|