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>
This commit is contained in:
Snider 2026-01-30 11:44:45 +00:00
parent bcf74fe84e
commit 6f6ee99008
26 changed files with 107 additions and 198 deletions

View file

@ -56,7 +56,7 @@ var taskCommitCmd = &cobra.Command{
// Get task details // Get task details
task, err := client.GetTask(ctx, taskID) task, err := client.GetTask(ctx, taskID)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.get_task"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "get task"}), err)
} }
// Build commit message with optional scope // Build commit message with optional scope
@ -77,7 +77,7 @@ var taskCommitCmd = &cobra.Command{
// Check for uncommitted changes // Check for uncommitted changes
hasChanges, err := agentic.HasUncommittedChanges(ctx, cwd) hasChanges, err := agentic.HasUncommittedChanges(ctx, cwd)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.git_status"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "check git status"}), err)
} }
if !hasChanges { if !hasChanges {
@ -88,7 +88,7 @@ var taskCommitCmd = &cobra.Command{
// Create commit // Create commit
fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.ai.task_commit.creating", map[string]interface{}{"ID": taskID})) fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.ai.task_commit.creating", map[string]interface{}{"ID": taskID}))
if err := agentic.AutoCommit(ctx, task, cwd, fullMessage); err != nil { if err := agentic.AutoCommit(ctx, task, cwd, fullMessage); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.commit"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "commit"}), err)
} }
fmt.Printf("%s %s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_commit.committed"), fullMessage) fmt.Printf("%s %s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_commit.committed"), fullMessage)
@ -97,9 +97,9 @@ var taskCommitCmd = &cobra.Command{
if taskCommitPush { if taskCommitPush {
fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.ai.task_commit.pushing")) fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.ai.task_commit.pushing"))
if err := agentic.PushChanges(ctx, cwd); err != nil { if err := agentic.PushChanges(ctx, cwd); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.push"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "push"}), err)
} }
fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_commit.pushed")) fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("common.success.completed", map[string]any{"Action": "Changes pushed"}))
} }
return nil return nil
@ -127,7 +127,7 @@ var taskPRCmd = &cobra.Command{
// Get task details // Get task details
task, err := client.GetTask(ctx, taskID) task, err := client.GetTask(ctx, taskID)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.get_task"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "get task"}), err)
} }
// Get current directory // Get current directory
@ -139,7 +139,7 @@ var taskPRCmd = &cobra.Command{
// Check current branch // Check current branch
branch, err := agentic.GetCurrentBranch(ctx, cwd) branch, err := agentic.GetCurrentBranch(ctx, cwd)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.get_branch"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "get current branch"}), err)
} }
if branch == "main" || branch == "master" { if branch == "main" || branch == "master" {
@ -151,7 +151,7 @@ var taskPRCmd = &cobra.Command{
if err := agentic.PushChanges(ctx, cwd); err != nil { if err := agentic.PushChanges(ctx, cwd); err != nil {
// Try setting upstream // Try setting upstream
if _, err := runGitCommand(cwd, "push", "-u", "origin", branch); err != nil { if _, err := runGitCommand(cwd, "push", "-u", "origin", branch); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.push_branch"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "push branch"}), err)
} }
} }
@ -170,7 +170,7 @@ var taskPRCmd = &cobra.Command{
fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.ai.task_pr.creating")) fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.ai.task_pr.creating"))
prURL, err := agentic.CreatePR(ctx, task, cwd, opts) prURL, err := agentic.CreatePR(ctx, task, cwd, opts)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.create_pr"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "create PR"}), err)
} }
fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_pr.created")) fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_pr.created"))

View file

@ -68,7 +68,7 @@ var tasksCmd = &cobra.Command{
tasks, err := client.ListTasks(ctx, opts) tasks, err := client.ListTasks(ctx, opts)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.list_tasks"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "list tasks"}), err)
} }
if len(tasks) == 0 { if len(tasks) == 0 {
@ -111,7 +111,7 @@ var taskCmd = &cobra.Command{
Limit: 50, Limit: 50,
}) })
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.list_tasks"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "list tasks"}), err)
} }
if len(tasks) == 0 { if len(tasks) == 0 {
@ -140,7 +140,7 @@ var taskCmd = &cobra.Command{
task, err = client.GetTask(ctx, taskID) task, err = client.GetTask(ctx, taskID)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.get_task"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "get task"}), err)
} }
} }
@ -149,7 +149,7 @@ var taskCmd = &cobra.Command{
cwd, _ := os.Getwd() cwd, _ := os.Getwd()
taskCtx, err := agentic.BuildTaskContext(task, cwd) taskCtx, err := agentic.BuildTaskContext(task, cwd)
if err != nil { if err != nil {
fmt.Printf("%s %s: %s\n", errorStyle.Render(">>"), i18n.T("cmd.ai.task.context_failed"), err) fmt.Printf("%s %s: %s\n", errorStyle.Render(">>"), i18n.T("common.error.failed", map[string]any{"Action": "build context"}), err)
} else { } else {
fmt.Println(taskCtx.FormatContext()) fmt.Println(taskCtx.FormatContext())
} }
@ -163,10 +163,10 @@ var taskCmd = &cobra.Command{
claimedTask, err := client.ClaimTask(ctx, task.ID) claimedTask, err := client.ClaimTask(ctx, task.ID)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.claim_task"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "claim task"}), err)
} }
fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task.claimed")) fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("common.success.completed", map[string]any{"Action": "Task claimed"}))
fmt.Printf(" %s %s\n", i18n.T("common.label.status"), formatTaskStatus(claimedTask.Status)) fmt.Printf(" %s %s\n", i18n.T("common.label.status"), formatTaskStatus(claimedTask.Status))
} }

View file

@ -57,10 +57,10 @@ var taskUpdateCmd = &cobra.Command{
} }
if err := client.UpdateTask(ctx, taskID, update); err != nil { if err := client.UpdateTask(ctx, taskID, update); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.update_task"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "update task"}), err)
} }
fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_update.success", map[string]interface{}{"ID": taskID})) fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("common.success.completed", map[string]any{"Action": "Task updated"}))
return nil return nil
}, },
} }
@ -90,13 +90,13 @@ var taskCompleteCmd = &cobra.Command{
} }
if err := client.CompleteTask(ctx, taskID, result); err != nil { if err := client.CompleteTask(ctx, taskID, result); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ai.error.complete_task"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "complete task"}), err)
} }
if taskCompleteFailed { if taskCompleteFailed {
fmt.Printf("%s %s\n", errorStyle.Render(">>"), i18n.T("cmd.ai.task_complete.failed", map[string]interface{}{"ID": taskID})) fmt.Printf("%s %s\n", errorStyle.Render(">>"), i18n.T("cmd.ai.task_complete.failed", map[string]interface{}{"ID": taskID}))
} else { } else {
fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("cmd.ai.task_complete.success", map[string]interface{}{"ID": taskID})) fmt.Printf("%s %s\n", successStyle.Render(">>"), i18n.T("common.success.completed", map[string]any{"Action": "Task completed"}))
} }
return nil return nil
}, },

View file

@ -41,7 +41,7 @@ func runProjectBuild(buildType string, ciMode bool, targetsFlag string, outputDi
} else { } else {
projectType, err = buildpkg.PrimaryType(projectDir) projectType, err = buildpkg.PrimaryType(projectDir)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.error.detect_type"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "detect project type"}), err)
} }
if projectType == "" { if projectType == "" {
return fmt.Errorf("%s", i18n.T("cmd.build.error.no_project_type", map[string]interface{}{"Dir": projectDir})) return fmt.Errorf("%s", i18n.T("cmd.build.error.no_project_type", map[string]interface{}{"Dir": projectDir}))
@ -240,7 +240,7 @@ func runProjectBuild(buildType string, ciMode bool, targetsFlag string, outputDi
// JSON output for CI // JSON output for CI
output, err := json.MarshalIndent(outputArtifacts, "", " ") output, err := json.MarshalIndent(outputArtifacts, "", " ")
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.error.marshal_artifacts"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "marshal artifacts"}), err)
} }
fmt.Println(string(output)) fmt.Println(string(output))
} }
@ -267,7 +267,7 @@ func computeAndWriteChecksums(ctx context.Context, projectDir, outputDir string,
checksumPath := filepath.Join(outputDir, "CHECKSUMS.txt") checksumPath := filepath.Join(outputDir, "CHECKSUMS.txt")
if err := buildpkg.WriteChecksumFile(checksummedArtifacts, checksumPath); err != nil { if err := buildpkg.WriteChecksumFile(checksummedArtifacts, checksumPath); err != nil {
if !ciMode { if !ciMode {
fmt.Printf("%s %s: %v\n", buildErrorStyle.Render(i18n.T("common.label.error")), i18n.T("cmd.build.error.write_checksums"), err) fmt.Printf("%s %s: %v\n", buildErrorStyle.Render(i18n.T("common.label.error")), i18n.T("common.error.failed", map[string]any{"Action": "write CHECKSUMS.txt"}), err)
} }
return nil, err return nil, err
} }

View file

@ -36,13 +36,13 @@ func runPwaBuild(pwaURL string) error {
tempDir, err := os.MkdirTemp("", "core-pwa-build-*") tempDir, err := os.MkdirTemp("", "core-pwa-build-*")
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.pwa.error.create_temp_dir"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "create temporary directory"}), err)
} }
// defer os.RemoveAll(tempDir) // Keep temp dir for debugging // defer os.RemoveAll(tempDir) // Keep temp dir for debugging
fmt.Printf("%s %s\n", i18n.T("cmd.build.pwa.downloading_to"), tempDir) fmt.Printf("%s %s\n", i18n.T("cmd.build.pwa.downloading_to"), tempDir)
if err := downloadPWA(pwaURL, tempDir); err != nil { if err := downloadPWA(pwaURL, tempDir); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.pwa.error.download_failed"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "download PWA"}), err)
} }
return runBuild(tempDir) return runBuild(tempDir)
@ -53,13 +53,13 @@ func downloadPWA(baseURL, destDir string) error {
// Fetch the main HTML page // Fetch the main HTML page
resp, err := http.Get(baseURL) resp, err := http.Get(baseURL)
if err != nil { if err != nil {
return fmt.Errorf("%s %s: %w", i18n.T("cmd.build.pwa.error.fetch_url"), baseURL, err) return fmt.Errorf("%s %s: %w", i18n.T("common.error.failed", map[string]any{"Action": "fetch URL"}), baseURL, err)
} }
defer resp.Body.Close() defer resp.Body.Close()
body, err := io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.pwa.error.read_response"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "read response body"}), err)
} }
// Find the manifest URL from the HTML // Find the manifest URL from the HTML
@ -68,7 +68,7 @@ func downloadPWA(baseURL, destDir string) error {
// If no manifest, it's not a PWA, but we can still try to package it as a simple site. // If no manifest, it's not a PWA, but we can still try to package it as a simple site.
fmt.Printf("%s %s\n", i18n.T("common.label.warning"), i18n.T("cmd.build.pwa.no_manifest")) fmt.Printf("%s %s\n", i18n.T("common.label.warning"), i18n.T("cmd.build.pwa.no_manifest"))
if err := os.WriteFile(filepath.Join(destDir, "index.html"), body, 0644); err != nil { if err := os.WriteFile(filepath.Join(destDir, "index.html"), body, 0644); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.pwa.error.write_index"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "write index.html"}), err)
} }
return nil return nil
} }
@ -78,20 +78,20 @@ func downloadPWA(baseURL, destDir string) error {
// Fetch and parse the manifest // Fetch and parse the manifest
manifest, err := fetchManifest(manifestURL) manifest, err := fetchManifest(manifestURL)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.pwa.error.fetch_manifest"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "fetch or parse manifest"}), err)
} }
// Download all assets listed in the manifest // Download all assets listed in the manifest
assets := collectAssets(manifest, manifestURL) assets := collectAssets(manifest, manifestURL)
for _, assetURL := range assets { for _, assetURL := range assets {
if err := downloadAsset(assetURL, destDir); err != nil { if err := downloadAsset(assetURL, destDir); err != nil {
fmt.Printf("%s %s %s: %v\n", i18n.T("common.label.warning"), i18n.T("cmd.build.pwa.asset_download_failed"), assetURL, err) fmt.Printf("%s %s %s: %v\n", i18n.T("common.label.warning"), i18n.T("common.error.failed", map[string]any{"Action": "download asset"}), assetURL, err)
} }
} }
// Also save the root index.html // Also save the root index.html
if err := os.WriteFile(filepath.Join(destDir, "index.html"), body, 0644); err != nil { if err := os.WriteFile(filepath.Join(destDir, "index.html"), body, 0644); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.pwa.error.write_index"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "write index.html"}), err)
} }
fmt.Println(i18n.T("cmd.build.pwa.download_complete")) fmt.Println(i18n.T("cmd.build.pwa.download_complete"))
@ -238,29 +238,29 @@ func runBuild(fromPath string) error {
outputExe := appName outputExe := appName
if err := os.RemoveAll(buildDir); err != nil { if err := os.RemoveAll(buildDir); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.from_path.error.clean_build_dir"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "clean build directory"}), err)
} }
// 1. Generate the project from the embedded template // 1. Generate the project from the embedded template
fmt.Println(i18n.T("cmd.build.from_path.generating_template")) fmt.Println(i18n.T("cmd.build.from_path.generating_template"))
templateFS, err := debme.FS(guiTemplate, "tmpl/gui") templateFS, err := debme.FS(guiTemplate, "tmpl/gui")
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.from_path.error.anchor_template"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "anchor template filesystem"}), err)
} }
sod := gosod.New(templateFS) sod := gosod.New(templateFS)
if sod == nil { if sod == nil {
return fmt.Errorf("%s", i18n.T("cmd.build.from_path.error.create_sod")) return fmt.Errorf("%s", i18n.T("common.error.failed", map[string]any{"Action": "create new sod instance"}))
} }
templateData := map[string]string{"AppName": appName} templateData := map[string]string{"AppName": appName}
if err := sod.Extract(buildDir, templateData); err != nil { if err := sod.Extract(buildDir, templateData); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.from_path.error.extract_template"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "extract template"}), err)
} }
// 2. Copy the user's web app files // 2. Copy the user's web app files
fmt.Println(i18n.T("cmd.build.from_path.copying_files")) fmt.Println(i18n.T("cmd.build.from_path.copying_files"))
if err := copyDir(fromPath, htmlDir); err != nil { if err := copyDir(fromPath, htmlDir); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.build.from_path.error.copy_files"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "copy application files"}), err)
} }
// 3. Compile the application // 3. Compile the application

View file

@ -24,7 +24,7 @@ func runChangelog(fromRef, toRef string) error {
// Generate changelog // Generate changelog
changelog, err := release.GenerateWithConfig(projectDir, fromRef, toRef, &cfg.Changelog) changelog, err := release.GenerateWithConfig(projectDir, fromRef, toRef, &cfg.Changelog)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ci.error.generate_changelog"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "generate changelog"}), err)
} }
fmt.Println(changelog) fmt.Println(changelog)

View file

@ -61,7 +61,7 @@ func runCIReleaseInit() error {
// Write config // Write config
if err := release.WriteConfig(cfg, projectDir); err != nil { if err := release.WriteConfig(cfg, projectDir); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ci.error.write_config"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "write config"}), err)
} }
fmt.Println() fmt.Println()

View file

@ -17,7 +17,7 @@ func runCIReleaseVersion() error {
version, err := release.DetermineVersion(projectDir) version, err := release.DetermineVersion(projectDir)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.ci.error.determine_version"), err) 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)) fmt.Printf("%s %s\n", i18n.T("common.label.version"), releaseValueStyle.Render(version))

View file

@ -26,7 +26,7 @@ func addSyncCommand(parent *cobra.Command) {
if err := runSync(); err != nil { if err := runSync(); err != nil {
return fmt.Errorf("%s %w", i18n.T("common.label.error"), err) return fmt.Errorf("%s %w", i18n.T("common.label.error"), err)
} }
fmt.Println(i18n.T("cmd.dev.sync.success")) fmt.Println(i18n.T("common.success.completed", map[string]any{"Action": "Public APIs synchronized"}))
return nil return nil
}, },
} }

View file

@ -30,7 +30,7 @@ func loadRegistry(registryPath string) (*repos.Registry, string, error) {
if registryPath != "" { if registryPath != "" {
reg, err = repos.LoadRegistry(registryPath) reg, err = repos.LoadRegistry(registryPath)
if err != nil { if err != nil {
return nil, "", fmt.Errorf("%s: %w", i18n.T("cmd.docs.error.load_registry"), err) return nil, "", fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "load registry"}), err)
} }
basePath = filepath.Dir(registryPath) basePath = filepath.Dir(registryPath)
} else { } else {
@ -38,14 +38,14 @@ func loadRegistry(registryPath string) (*repos.Registry, string, error) {
if err == nil { if err == nil {
reg, err = repos.LoadRegistry(registryPath) reg, err = repos.LoadRegistry(registryPath)
if err != nil { if err != nil {
return nil, "", fmt.Errorf("%s: %w", i18n.T("cmd.docs.error.load_registry"), err) return nil, "", fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "load registry"}), err)
} }
basePath = filepath.Dir(registryPath) basePath = filepath.Dir(registryPath)
} else { } else {
cwd, _ := os.Getwd() cwd, _ := os.Getwd()
reg, err = repos.ScanDirectory(cwd) reg, err = repos.ScanDirectory(cwd)
if err != nil { if err != nil {
return nil, "", fmt.Errorf("%s: %w", i18n.T("cmd.docs.error.scan_directory"), err) return nil, "", fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "scan directory"}), err)
} }
basePath = cwd basePath = cwd
} }

View file

@ -33,7 +33,7 @@ func init() {
} }
func runDoctor(verbose bool) error { func runDoctor(verbose bool) error {
fmt.Println(i18n.T("cmd.doctor.checking")) fmt.Println(i18n.T("common.progress.checking", map[string]any{"Item": "development environment"}))
fmt.Println() fmt.Println()
var passed, failed, optional int var passed, failed, optional int

View file

@ -73,7 +73,7 @@ func runGoTest(coverage bool, pkg, run string, short, race, jsonOut, verbose boo
args = append(args, pkg) args = append(args, pkg)
if !jsonOut { if !jsonOut {
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("common.label.test")), i18n.T("common.result.running_tests")) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("common.label.test")), i18n.T("common.progress.running", map[string]any{"Task": "tests"}))
fmt.Printf(" %s %s\n", dimStyle.Render(i18n.T("common.label.package")), pkg) fmt.Printf(" %s %s\n", dimStyle.Render(i18n.T("common.label.package")), pkg)
fmt.Println() fmt.Println()
} }
@ -176,7 +176,7 @@ func addGoCovCommand(parent *cobra.Command) {
// Auto-discover packages with tests // Auto-discover packages with tests
pkgs, err := findTestPackages(".") pkgs, err := findTestPackages(".")
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.go.cov.error.discover"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "discover test packages"}), err)
} }
if len(pkgs) == 0 { if len(pkgs) == 0 {
return fmt.Errorf(i18n.T("cmd.go.cov.error.no_packages")) return fmt.Errorf(i18n.T("cmd.go.cov.error.no_packages"))
@ -187,13 +187,13 @@ func addGoCovCommand(parent *cobra.Command) {
// Create temp file for coverage data // Create temp file for coverage data
covFile, err := os.CreateTemp("", "coverage-*.out") covFile, err := os.CreateTemp("", "coverage-*.out")
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.go.cov.error.create_file"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "create coverage file"}), err)
} }
covPath := covFile.Name() covPath := covFile.Name()
covFile.Close() covFile.Close()
defer os.Remove(covPath) defer os.Remove(covPath)
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("common.label.coverage")), i18n.T("cmd.go.cov.running")) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("common.label.coverage")), i18n.T("common.progress.running", map[string]any{"Task": "tests with coverage"}))
// Truncate package list if too long for display // Truncate package list if too long for display
displayPkg := pkg displayPkg := pkg
if len(displayPkg) > 60 { if len(displayPkg) > 60 {
@ -221,7 +221,7 @@ func addGoCovCommand(parent *cobra.Command) {
if testErr != nil { if testErr != nil {
return testErr return testErr
} }
return fmt.Errorf("%s: %w", i18n.T("cmd.go.cov.error.get_coverage"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "get coverage"}), err)
} }
// Parse total coverage from last line // Parse total coverage from last line
@ -248,7 +248,7 @@ func addGoCovCommand(parent *cobra.Command) {
htmlPath := "coverage.html" htmlPath := "coverage.html"
htmlCmd := exec.Command("go", "tool", "cover", "-html="+covPath, "-o="+htmlPath) htmlCmd := exec.Command("go", "tool", "cover", "-html="+covPath, "-o="+htmlPath)
if err := htmlCmd.Run(); err != nil { if err := htmlCmd.Run(); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.go.cov.error.generate_html"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "generate HTML"}), err)
} }
fmt.Printf(" %s %s\n", dimStyle.Render(i18n.T("cmd.go.cov.html_label")), htmlPath) fmt.Printf(" %s %s\n", dimStyle.Render(i18n.T("cmd.go.cov.html_label")), htmlPath)

View file

@ -92,7 +92,7 @@ func runPHPBuildDocker(ctx context.Context, projectDir string, opts dockerBuildO
// Show detected configuration // Show detected configuration
config, err := phppkg.DetectDockerfileConfig(projectDir) config, err := phppkg.DetectDockerfileConfig(projectDir)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.detect_config"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "detect project configuration"}), err)
} }
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.php.build.php_version")), config.PHPVersion) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.php.build.php_version")), config.PHPVersion)
@ -138,7 +138,7 @@ func runPHPBuildDocker(ctx context.Context, projectDir string, opts dockerBuildO
return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "build"}), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "build"}), err)
} }
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.build.docker_success")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("common.success.completed", map[string]any{"Action": "Docker image built"}))
fmt.Printf("%s docker run -p 80:80 -p 443:443 %s:%s\n", fmt.Printf("%s docker run -p 80:80 -p 443:443 %s:%s\n",
dimStyle.Render(i18n.T("cmd.php.build.docker_run_with")), dimStyle.Render(i18n.T("cmd.php.build.docker_run_with")),
buildOpts.ImageName, buildOpts.Tag) buildOpts.ImageName, buildOpts.Tag)
@ -176,7 +176,7 @@ func runPHPBuildLinuxKit(ctx context.Context, projectDir string, opts linuxKitBu
return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "build"}), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "build"}), err)
} }
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.build.linuxkit_success")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("common.success.completed", map[string]any{"Action": "LinuxKit image built"}))
return nil return nil
} }
@ -224,7 +224,7 @@ func addPHPServeCommand(parent *cobra.Command) {
Output: os.Stdout, Output: os.Stdout,
} }
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.serve.running")) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("common.progress.running", map[string]any{"Task": "production container"}))
fmt.Printf("%s %s:%s\n", dimStyle.Render(i18n.T("common.label.image")), imageName, func() string { fmt.Printf("%s %s:%s\n", dimStyle.Render(i18n.T("common.label.image")), imageName, func() string {
if serveTag == "" { if serveTag == "" {
return "latest" return "latest"
@ -246,7 +246,7 @@ func addPHPServeCommand(parent *cobra.Command) {
fmt.Println() fmt.Println()
if err := phppkg.ServeProduction(ctx, opts); err != nil { if err := phppkg.ServeProduction(ctx, opts); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.start_container"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "start container"}), err)
} }
if !serveDetach { if !serveDetach {
@ -280,7 +280,7 @@ func addPHPShellCommand(parent *cobra.Command) {
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.shell.opening", map[string]interface{}{"Container": args[0]})) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.shell.opening", map[string]interface{}{"Container": args[0]}))
if err := phppkg.Shell(ctx, args[0]); err != nil { if err := phppkg.Shell(ctx, args[0]); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.open_shell"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "open shell"}), err)
} }
return nil return nil

View file

@ -75,7 +75,7 @@ func addPHPDeployCommand(parent *cobra.Command) {
if deployWait { if deployWait {
if phppkg.IsDeploymentSuccessful(status.Status) { if phppkg.IsDeploymentSuccessful(status.Status) {
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.deploy.success")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("common.success.completed", map[string]any{"Action": "Deployment completed"}))
} else { } else {
fmt.Printf("\n%s %s\n", errorStyle.Render(i18n.T("common.label.warning")), i18n.T("cmd.php.deploy.warning_status", map[string]interface{}{"Status": status.Status})) fmt.Printf("\n%s %s\n", errorStyle.Render(i18n.T("common.label.warning")), i18n.T("cmd.php.deploy.warning_status", map[string]interface{}{"Status": status.Status}))
} }
@ -115,7 +115,7 @@ func addPHPDeployStatusCommand(parent *cobra.Command) {
env = phppkg.EnvStaging env = phppkg.EnvStaging
} }
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.deploy")), i18n.T("cmd.php.deploy_status.checking", map[string]interface{}{"Environment": env})) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.deploy")), i18n.T("common.progress.checking", map[string]any{"Item": "deployment status"}))
ctx := context.Background() ctx := context.Background()
@ -127,7 +127,7 @@ func addPHPDeployStatusCommand(parent *cobra.Command) {
status, err := phppkg.DeployStatus(ctx, opts) status, err := phppkg.DeployStatus(ctx, opts)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.status_failed"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "get status"}), err)
} }
printDeploymentStatus(status) printDeploymentStatus(status)
@ -184,7 +184,7 @@ func addPHPDeployRollbackCommand(parent *cobra.Command) {
if rollbackWait { if rollbackWait {
if phppkg.IsDeploymentSuccessful(status.Status) { if phppkg.IsDeploymentSuccessful(status.Status) {
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.deploy_rollback.success")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("common.success.completed", map[string]any{"Action": "Rollback completed"}))
} else { } else {
fmt.Printf("\n%s %s\n", errorStyle.Render(i18n.T("common.label.warning")), i18n.T("cmd.php.deploy_rollback.warning_status", map[string]interface{}{"Status": status.Status})) fmt.Printf("\n%s %s\n", errorStyle.Render(i18n.T("common.label.warning")), i18n.T("cmd.php.deploy_rollback.warning_status", map[string]interface{}{"Status": status.Status}))
} }
@ -235,7 +235,7 @@ func addPHPDeployListCommand(parent *cobra.Command) {
deployments, err := phppkg.ListDeployments(ctx, cwd, env, limit) deployments, err := phppkg.ListDeployments(ctx, cwd, env, limit)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.list_deployments"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "list deployments"}), err)
} }
if len(deployments) == 0 { if len(deployments) == 0 {

View file

@ -126,7 +126,7 @@ func runPHPDev(opts phpDevOptions) error {
}() }()
if err := server.Start(ctx, devOpts); err != nil { if err := server.Start(ctx, devOpts); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.start_services"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "start services"}), err)
} }
// Print status // Print status
@ -155,7 +155,7 @@ func runPHPDev(opts phpDevOptions) error {
// Stream unified logs // Stream unified logs
logsReader, err := server.Logs("", true) logsReader, err := server.Logs("", true)
if err != nil { if err != nil {
fmt.Printf("%s %s\n", errorStyle.Render(i18n.T("common.label.warning")), i18n.T("cmd.php.dev.logs_failed", map[string]interface{}{"Error": err})) fmt.Printf("%s %s\n", errorStyle.Render(i18n.T("common.label.warning")), i18n.T("common.error.failed", map[string]any{"Action": "get logs"}))
} else { } else {
defer logsReader.Close() defer logsReader.Close()
@ -270,7 +270,7 @@ func runPHPStop() error {
// This is a simplified version - in practice you'd want to track PIDs // This is a simplified version - in practice you'd want to track PIDs
server := phppkg.NewDevServer(phppkg.Options{Dir: cwd}) server := phppkg.NewDevServer(phppkg.Options{Dir: cwd})
if err := server.Stop(); err != nil { if err := server.Stop(); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.stop_services"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "stop services"}), err)
} }
fmt.Printf("%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.dev.all_stopped")) fmt.Printf("%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.dev.all_stopped"))
@ -394,7 +394,7 @@ func runPHPSSL(domain string) error {
// Setup SSL // Setup SSL
if err := phppkg.SetupSSL(domain, phppkg.SSLOptions{}); err != nil { if err := phppkg.SetupSSL(domain, phppkg.SSLOptions{}); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.ssl_setup"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "setup SSL"}), err)
} }
certFile, keyFile, _ := phppkg.CertPaths(domain, phppkg.SSLOptions{}) certFile, keyFile, _ := phppkg.CertPaths(domain, phppkg.SSLOptions{})

View file

@ -38,7 +38,7 @@ func addPHPPackagesLinkCommand(parent *cobra.Command) {
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.packages.link.linking")) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.packages.link.linking"))
if err := phppkg.LinkPackages(cwd, args); err != nil { if err := phppkg.LinkPackages(cwd, args); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.link_packages"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "link packages"}), err)
} }
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.packages.link.done")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.packages.link.done"))
@ -64,7 +64,7 @@ func addPHPPackagesUnlinkCommand(parent *cobra.Command) {
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.packages.unlink.unlinking")) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.packages.unlink.unlinking"))
if err := phppkg.UnlinkPackages(cwd, args); err != nil { if err := phppkg.UnlinkPackages(cwd, args); err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.unlink_packages"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "unlink packages"}), err)
} }
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.packages.unlink.done")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.packages.unlink.done"))
@ -113,7 +113,7 @@ func addPHPPackagesListCommand(parent *cobra.Command) {
packages, err := phppkg.ListLinkedPackages(cwd) packages, err := phppkg.ListLinkedPackages(cwd)
if err != nil { if err != nil {
return fmt.Errorf("%s: %w", i18n.T("cmd.php.error.list_packages"), err) return fmt.Errorf("%s: %w", i18n.T("common.error.failed", map[string]any{"Action": "list packages"}), err)
} }
if len(packages) == 0 { if len(packages) == 0 {

View file

@ -37,9 +37,7 @@ func addPHPTestCommand(parent *cobra.Command) {
return fmt.Errorf(i18n.T("cmd.php.error.not_php")) return fmt.Errorf(i18n.T("cmd.php.error.not_php"))
} }
// Detect test runner fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("common.progress.running", map[string]any{"Task": "tests"}))
runner := phppkg.DetectTestRunner(cwd)
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.test.running", map[string]interface{}{"Runner": runner}))
ctx := context.Background() ctx := context.Background()
@ -101,7 +99,7 @@ func addPHPFmtCommand(parent *cobra.Command) {
if fmtFix { if fmtFix {
msg = i18n.T("cmd.php.fmt.formatting", map[string]interface{}{"Formatter": formatter}) msg = i18n.T("cmd.php.fmt.formatting", map[string]interface{}{"Formatter": formatter})
} else { } else {
msg = i18n.T("cmd.php.fmt.checking", map[string]interface{}{"Formatter": formatter}) msg = i18n.T("common.progress.checking", map[string]any{"Item": "code style"})
} }
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), msg) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), msg)
@ -127,7 +125,7 @@ func addPHPFmtCommand(parent *cobra.Command) {
} }
if fmtFix { if fmtFix {
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.fmt.success")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("common.success.completed", map[string]any{"Action": "Code formatted"}))
} else { } else {
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.fmt.no_issues")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.fmt.no_issues"))
} }
@ -163,12 +161,12 @@ func addPHPAnalyseCommand(parent *cobra.Command) {
} }
// Detect analyser // Detect analyser
analyser, found := phppkg.DetectAnalyser(cwd) _, found := phppkg.DetectAnalyser(cwd)
if !found { if !found {
return fmt.Errorf(i18n.T("cmd.php.analyse.no_analyser")) return fmt.Errorf(i18n.T("cmd.php.analyse.no_analyser"))
} }
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("cmd.php.analyse.running", map[string]interface{}{"Analyser": analyser})) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.php")), i18n.T("common.progress.running", map[string]any{"Task": "static analysis"}))
ctx := context.Background() ctx := context.Background()
@ -383,7 +381,7 @@ func addPHPSecurityCommand(parent *cobra.Command) {
return fmt.Errorf(i18n.T("cmd.php.error.not_php")) return fmt.Errorf(i18n.T("cmd.php.error.not_php"))
} }
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.security")), i18n.T("cmd.php.security.running")) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.security")), i18n.T("common.progress.running", map[string]any{"Task": "security checks"}))
ctx := context.Background() ctx := context.Background()
@ -495,7 +493,7 @@ func addPHPQACommand(parent *cobra.Command) {
for i, s := range stages { for i, s := range stages {
stageNames[i] = string(s) stageNames[i] = string(s)
} }
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.qa")), i18n.T("cmd.php.qa.running", map[string]interface{}{"Stages": strings.Join(stageNames, " -> ")})) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.qa")), i18n.T("common.progress.running", map[string]any{"Task": "QA pipeline"}))
ctx := context.Background() ctx := context.Background()
var allPassed = true var allPassed = true
@ -725,7 +723,7 @@ func addPHPRectorCommand(parent *cobra.Command) {
} }
if rectorFix { if rectorFix {
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.rector.refactored")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("common.success.completed", map[string]any{"Action": "Code refactored"}))
} else { } else {
fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.rector.no_changes")) fmt.Printf("\n%s %s\n", successStyle.Render(i18n.T("common.label.done")), i18n.T("cmd.php.rector.no_changes"))
} }
@ -770,7 +768,7 @@ func addPHPInfectionCommand(parent *cobra.Command) {
return fmt.Errorf(i18n.T("cmd.php.error.infection_not_installed")) return fmt.Errorf(i18n.T("cmd.php.error.infection_not_installed"))
} }
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.php.label.infection")), i18n.T("cmd.php.infection.running")) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.php.label.infection")), i18n.T("common.progress.running", map[string]any{"Task": "mutation testing"}))
fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.info")), i18n.T("cmd.php.infection.note")) fmt.Printf("%s %s\n\n", dimStyle.Render(i18n.T("cmd.php.label.info")), i18n.T("cmd.php.infection.note"))
ctx := context.Background() ctx := context.Background()

View file

@ -78,7 +78,7 @@ func runPkgInstall(repoArg, targetDir string, addToRegistry bool) error {
} }
if err := os.MkdirAll(targetDir, 0755); err != nil { if err := os.MkdirAll(targetDir, 0755); err != nil {
return fmt.Errorf(i18n.T("cmd.pkg.error.create_directory"), err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "create directory"}), err)
} }
fmt.Printf("%s %s/%s\n", dimStyle.Render(i18n.T("cmd.pkg.install.installing_label")), org, repoName) fmt.Printf("%s %s/%s\n", dimStyle.Render(i18n.T("cmd.pkg.install.installing_label")), org, repoName)

View file

@ -34,7 +34,7 @@ func runPkgList() error {
reg, err := repos.LoadRegistry(regPath) reg, err := repos.LoadRegistry(regPath)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.pkg.error.load_registry"), err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "load registry"}), err)
} }
basePath := reg.BasePath basePath := reg.BasePath
@ -120,7 +120,7 @@ func runPkgUpdate(packages []string, all bool) error {
reg, err := repos.LoadRegistry(regPath) reg, err := repos.LoadRegistry(regPath)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.pkg.error.load_registry"), err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "load registry"}), err)
} }
basePath := reg.BasePath basePath := reg.BasePath
@ -200,7 +200,7 @@ func runPkgOutdated() error {
reg, err := repos.LoadRegistry(regPath) reg, err := repos.LoadRegistry(regPath)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.pkg.error.load_registry"), err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "load registry"}), err)
} }
basePath := reg.BasePath basePath := reg.BasePath

View file

@ -118,7 +118,7 @@ func runPkgSearch(org, pattern, repoType string, limit int, refresh bool) error
} }
if err := json.Unmarshal(output, &ghRepos); err != nil { if err := json.Unmarshal(output, &ghRepos); err != nil {
return fmt.Errorf(i18n.T("cmd.pkg.error.parse_results"), err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "parse results"}), err)
} }
if c != nil { if c != nil {

View file

@ -80,7 +80,7 @@ func runSDKDiff(basePath, specPath string) error {
return fmt.Errorf(i18n.T("cmd.sdk.diff.error.base_required")) return fmt.Errorf(i18n.T("cmd.sdk.diff.error.base_required"))
} }
fmt.Printf("%s %s\n", sdkHeaderStyle.Render(i18n.T("cmd.sdk.diff.label")), i18n.T("cmd.sdk.diff.checking")) fmt.Printf("%s %s\n", sdkHeaderStyle.Render(i18n.T("cmd.sdk.diff.label")), i18n.T("common.progress.checking", map[string]any{"Item": "breaking changes"}))
fmt.Printf(" %s %s\n", i18n.T("cmd.sdk.diff.base_label"), sdkDimStyle.Render(basePath)) fmt.Printf(" %s %s\n", i18n.T("cmd.sdk.diff.base_label"), sdkDimStyle.Render(basePath))
fmt.Printf(" %s %s\n", i18n.T("common.label.current"), sdkDimStyle.Render(specPath)) fmt.Printf(" %s %s\n", i18n.T("common.label.current"), sdkDimStyle.Render(specPath))
fmt.Println() fmt.Println()

View file

@ -200,7 +200,7 @@ func runRegistrySetupWithReg(ctx context.Context, reg *repos.Registry, registryP
// Run build if requested // Run build if requested
if runBuild && succeeded > 0 { if runBuild && succeeded > 0 {
fmt.Println() fmt.Println()
fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("cmd.setup.running_build")) fmt.Printf("%s %s\n", dimStyle.Render(">>"), i18n.T("common.progress.running", map[string]any{"Task": "build"}))
buildCmd := exec.Command("core", "build") buildCmd := exec.Command("core", "build")
buildCmd.Dir = basePath buildCmd.Dir = basePath
buildCmd.Stdout = os.Stdout buildCmd.Stdout = os.Stdout

View file

@ -54,7 +54,7 @@ func runTest(verbose, coverage, short bool, pkg, run string, race, jsonOutput bo
cmd.Env = append(os.Environ(), getMacOSDeploymentTarget()) cmd.Env = append(os.Environ(), getMacOSDeploymentTarget())
if !jsonOutput { if !jsonOutput {
fmt.Printf("%s %s\n", testHeaderStyle.Render(i18n.T("common.label.test")), i18n.T("common.result.running_tests")) fmt.Printf("%s %s\n", testHeaderStyle.Render(i18n.T("common.label.test")), i18n.T("common.progress.running", map[string]any{"Task": "tests"}))
fmt.Printf(" %s %s\n", i18n.T("common.label.package"), testDimStyle.Render(pkg)) fmt.Printf(" %s %s\n", i18n.T("common.label.package"), testDimStyle.Render(pkg))
if run != "" { if run != "" {
fmt.Printf(" %s %s\n", i18n.T("common.label.filter"), testDimStyle.Render(run)) fmt.Printf(" %s %s\n", i18n.T("common.label.filter"), testDimStyle.Render(run))

View file

@ -69,7 +69,7 @@ func addVMRunCommand(parent *cobra.Command) {
func runContainer(image, name string, detach bool, memory, cpus, sshPort int) error { func runContainer(image, name string, detach bool, memory, cpus, sshPort int) error {
manager, err := container.NewLinuxKitManager() manager, err := container.NewLinuxKitManager()
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.init_manager")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "initialize container manager"})+": %w", err)
} }
opts := container.RunOptions{ opts := container.RunOptions{
@ -90,7 +90,7 @@ func runContainer(image, name string, detach bool, memory, cpus, sshPort int) er
ctx := context.Background() ctx := context.Background()
c, err := manager.Run(ctx, image, opts) c, err := manager.Run(ctx, image, opts)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.run_container")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "run container"})+": %w", err)
} }
if detach { if detach {
@ -127,13 +127,13 @@ func addVMPsCommand(parent *cobra.Command) {
func listContainers(all bool) error { func listContainers(all bool) error {
manager, err := container.NewLinuxKitManager() manager, err := container.NewLinuxKitManager()
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.init_manager")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "initialize container manager"})+": %w", err)
} }
ctx := context.Background() ctx := context.Background()
containers, err := manager.List(ctx) containers, err := manager.List(ctx)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.list_containers")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "list containers"})+": %w", err)
} }
// Filter if not showing all // Filter if not showing all
@ -222,7 +222,7 @@ func addVMStopCommand(parent *cobra.Command) {
func stopContainer(id string) error { func stopContainer(id string) error {
manager, err := container.NewLinuxKitManager() manager, err := container.NewLinuxKitManager()
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.init_manager")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "initialize container manager"})+": %w", err)
} }
// Support partial ID matching // Support partial ID matching
@ -235,7 +235,7 @@ func stopContainer(id string) error {
ctx := context.Background() ctx := context.Background()
if err := manager.Stop(ctx, fullID); err != nil { if err := manager.Stop(ctx, fullID); err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.stop_container")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "stop container"})+": %w", err)
} }
fmt.Printf("%s\n", successStyle.Render(i18n.T("common.status.stopped"))) fmt.Printf("%s\n", successStyle.Render(i18n.T("common.status.stopped")))
@ -291,7 +291,7 @@ func addVMLogsCommand(parent *cobra.Command) {
func viewLogs(id string, follow bool) error { func viewLogs(id string, follow bool) error {
manager, err := container.NewLinuxKitManager() manager, err := container.NewLinuxKitManager()
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.init_manager")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "initialize container manager"})+": %w", err)
} }
fullID, err := resolveContainerID(manager, id) fullID, err := resolveContainerID(manager, id)
@ -330,7 +330,7 @@ func addVMExecCommand(parent *cobra.Command) {
func execInContainer(id string, cmd []string) error { func execInContainer(id string, cmd []string) error {
manager, err := container.NewLinuxKitManager() manager, err := container.NewLinuxKitManager()
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.init_manager")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "initialize container manager"})+": %w", err)
} }
fullID, err := resolveContainerID(manager, id) fullID, err := resolveContainerID(manager, id)

View file

@ -149,20 +149,20 @@ func RunFromTemplate(templateName string, vars map[string]string, runOpts contai
// Apply template with variables // Apply template with variables
content, err := container.ApplyTemplate(templateName, vars) content, err := container.ApplyTemplate(templateName, vars)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.apply_template")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "apply template"})+": %w", err)
} }
// Create a temporary directory for the build // Create a temporary directory for the build
tmpDir, err := os.MkdirTemp("", "core-linuxkit-*") tmpDir, err := os.MkdirTemp("", "core-linuxkit-*")
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.create_temp")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "create temp directory"})+": %w", err)
} }
defer os.RemoveAll(tmpDir) defer os.RemoveAll(tmpDir)
// Write the YAML file // Write the YAML file
yamlPath := filepath.Join(tmpDir, templateName+".yml") yamlPath := filepath.Join(tmpDir, templateName+".yml")
if err := os.WriteFile(yamlPath, []byte(content), 0644); err != nil { if err := os.WriteFile(yamlPath, []byte(content), 0644); err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.write_template")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "write template"})+": %w", err)
} }
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("common.label.template")), repoNameStyle.Render(templateName)) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("common.label.template")), repoNameStyle.Render(templateName))
@ -171,7 +171,7 @@ func RunFromTemplate(templateName string, vars map[string]string, runOpts contai
// Build the image using linuxkit // Build the image using linuxkit
outputPath := filepath.Join(tmpDir, templateName) outputPath := filepath.Join(tmpDir, templateName)
if err := buildLinuxKitImage(yamlPath, outputPath); err != nil { if err := buildLinuxKitImage(yamlPath, outputPath); err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.build_image")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "build image"})+": %w", err)
} }
// Find the built image (linuxkit creates .iso or other format) // Find the built image (linuxkit creates .iso or other format)
@ -186,7 +186,7 @@ func RunFromTemplate(templateName string, vars map[string]string, runOpts contai
// Run the image // Run the image
manager, err := container.NewLinuxKitManager() manager, err := container.NewLinuxKitManager()
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.init_manager")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "initialize container manager"})+": %w", err)
} }
fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.vm.label.hypervisor")), manager.Hypervisor().Name()) fmt.Printf("%s %s\n", dimStyle.Render(i18n.T("cmd.vm.label.hypervisor")), manager.Hypervisor().Name())
@ -195,7 +195,7 @@ func RunFromTemplate(templateName string, vars map[string]string, runOpts contai
ctx := context.Background() ctx := context.Background()
c, err := manager.Run(ctx, imagePath, runOpts) c, err := manager.Run(ctx, imagePath, runOpts)
if err != nil { if err != nil {
return fmt.Errorf(i18n.T("cmd.vm.error.run_container")+": %w", err) return fmt.Errorf(i18n.T("common.error.failed", map[string]any{"Action": "run container"})+": %w", err)
} }
if runOpts.Detach { if runOpts.Detach {

View file

@ -76,7 +76,6 @@
"result": { "result": {
"all_passed": "All tests passed", "all_passed": "All tests passed",
"no_issues": "No issues found", "no_issues": "No issues found",
"running_tests": "Running tests",
"run_with_coverage": "Run tests with coverage" "run_with_coverage": "Run tests with coverage"
}, },
"hint": { "hint": {
@ -154,19 +153,6 @@
}, },
"short": "Claude Code integration" "short": "Claude Code integration"
}, },
"error": {
"claim_task": "failed to claim task",
"commit": "failed to commit",
"complete_task": "failed to complete task",
"create_pr": "failed to create PR",
"get_branch": "failed to get current branch",
"get_task": "failed to get task",
"git_status": "failed to check git status",
"list_tasks": "failed to list tasks",
"push": "failed to push",
"push_branch": "failed to push branch",
"update_task": "failed to update task"
},
"label": { "label": {
"blocked_by": "Blocked by:", "blocked_by": "Blocked by:",
"claimed_by": "Claimed by:", "claimed_by": "Claimed by:",
@ -193,9 +179,7 @@
"pending": "pending" "pending": "pending"
}, },
"task": { "task": {
"claimed": "Task claimed successfully!",
"claiming": "Claiming task...", "claiming": "Claiming task...",
"context_failed": "Failed to build context",
"flag": { "flag": {
"auto": "Auto-select highest priority pending task", "auto": "Auto-select highest priority pending task",
"claim": "Claim the task after showing details", "claim": "Claim the task after showing details",
@ -217,7 +201,6 @@
"long": "Creates a git commit with a task reference and co-author attribution.\n\nCommit message format:\n feat(scope): description\n\n Task: #123\n Co-Authored-By: Claude <noreply@anthropic.com>\n\nExamples:\n core ai task:commit abc123 --message 'add user authentication'\n core ai task:commit abc123 -m 'fix login bug' --scope auth\n core ai task:commit abc123 -m 'update docs' --push", "long": "Creates a git commit with a task reference and co-author attribution.\n\nCommit message format:\n feat(scope): description\n\n Task: #123\n Co-Authored-By: Claude <noreply@anthropic.com>\n\nExamples:\n core ai task:commit abc123 --message 'add user authentication'\n core ai task:commit abc123 -m 'fix login bug' --scope auth\n core ai task:commit abc123 -m 'update docs' --push",
"message_required": "commit message required (--message or -m)", "message_required": "commit message required (--message or -m)",
"no_changes": "No uncommitted changes to commit.", "no_changes": "No uncommitted changes to commit.",
"pushed": "Changes pushed successfully",
"pushing": "Pushing changes...", "pushing": "Pushing changes...",
"short": "Auto-commit changes with task reference" "short": "Auto-commit changes with task reference"
}, },
@ -229,8 +212,7 @@
"output": "Summary of the completed work" "output": "Summary of the completed work"
}, },
"long": "Marks a task as completed with optional output and artifacts.\n\nExamples:\n core ai task:complete abc123 --output 'Feature implemented'\n core ai task:complete abc123 --failed --error 'Build failed'", "long": "Marks a task as completed with optional output and artifacts.\n\nExamples:\n core ai task:complete abc123 --output 'Feature implemented'\n core ai task:complete abc123 --failed --error 'Build failed'",
"short": "Mark a task as completed", "short": "Mark a task as completed"
"success": "Task {{.ID}} completed successfully"
}, },
"task_pr": { "task_pr": {
"branch_error": "cannot create PR from {{.Branch}} branch; create a feature branch first", "branch_error": "cannot create PR from {{.Branch}} branch; create a feature branch first",
@ -254,8 +236,7 @@
}, },
"flag_required": "at least one of --status, --progress, or --notes required", "flag_required": "at least one of --status, --progress, or --notes required",
"long": "Updates a task's status, progress, or adds notes.\n\nExamples:\n core ai task:update abc123 --status in_progress\n core ai task:update abc123 --progress 50 --notes 'Halfway done'", "long": "Updates a task's status, progress, or adds notes.\n\nExamples:\n core ai task:update abc123 --status in_progress\n core ai task:update abc123 --progress 50 --notes 'Halfway done'",
"short": "Update task status or progress", "short": "Update task status or progress"
"success": "Task {{.ID}} updated successfully"
}, },
"tasks": { "tasks": {
"flag": { "flag": {
@ -280,18 +261,15 @@
"error": { "error": {
"archive_failed": "archive failed", "archive_failed": "archive failed",
"checksum_failed": "checksum failed", "checksum_failed": "checksum failed",
"detect_type": "failed to detect project type",
"gpg_signing_failed": "GPG signing failed", "gpg_signing_failed": "GPG signing failed",
"invalid_target": "invalid target format \"{{.Target}}\", expected OS/arch (e.g., linux/amd64)", "invalid_target": "invalid target format \"{{.Target}}\", expected OS/arch (e.g., linux/amd64)",
"marshal_artifacts": "failed to marshal artifacts",
"no_project_type": "no supported project type detected in {{.Dir}}\nSupported types: go (go.mod), wails (wails.json), node (package.json), php (composer.json)", "no_project_type": "no supported project type detected in {{.Dir}}\nSupported types: go (go.mod), wails (wails.json), node (package.json), php (composer.json)",
"no_targets": "no valid targets specified", "no_targets": "no valid targets specified",
"node_not_implemented": "Node.js builder not yet implemented", "node_not_implemented": "Node.js builder not yet implemented",
"notarization_failed": "notarization failed", "notarization_failed": "notarization failed",
"php_not_implemented": "PHP builder not yet implemented", "php_not_implemented": "PHP builder not yet implemented",
"signing_failed": "signing failed", "signing_failed": "signing failed",
"unsupported_type": "unsupported project type", "unsupported_type": "unsupported project type"
"write_checksums": "failed to write CHECKSUMS.txt"
}, },
"flag": { "flag": {
"archive": "Create archives (tar.gz for linux/darwin, zip for windows)", "archive": "Create archives (tar.gz for linux/darwin, zip for windows)",
@ -311,11 +289,6 @@
"compiling": "Compiling application...", "compiling": "Compiling application...",
"copying_files": "Copying application files...", "copying_files": "Copying application files...",
"error": { "error": {
"anchor_template": "failed to anchor template filesystem",
"clean_build_dir": "failed to clean build directory",
"copy_files": "failed to copy application files",
"create_sod": "failed to create new sod instance",
"extract_template": "failed to extract template",
"go_build": "go build failed", "go_build": "go build failed",
"go_mod_tidy": "go mod tidy failed", "go_mod_tidy": "go mod tidy failed",
"invalid_path": "invalid path specified", "invalid_path": "invalid path specified",
@ -342,17 +315,10 @@
}, },
"long": "Builds the current project with automatic type detection.\nSupports Go, Wails, Docker, LinuxKit, and Taskfile projects.\nConfiguration can be provided via .core/build.yaml or command-line flags.\n\nExamples:\n core build # Auto-detect and build\n core build --type docker # Build Docker image\n core build --type linuxkit # Build LinuxKit image\n core build --type linuxkit --config linuxkit.yml --format qcow2-bios", "long": "Builds the current project with automatic type detection.\nSupports Go, Wails, Docker, LinuxKit, and Taskfile projects.\nConfiguration can be provided via .core/build.yaml or command-line flags.\n\nExamples:\n core build # Auto-detect and build\n core build --type docker # Build Docker image\n core build --type linuxkit # Build LinuxKit image\n core build --type linuxkit --config linuxkit.yml --format qcow2-bios",
"pwa": { "pwa": {
"asset_download_failed": "failed to download asset",
"download_complete": "PWA download complete.", "download_complete": "PWA download complete.",
"downloading_to": "Downloading PWA to temporary directory:", "downloading_to": "Downloading PWA to temporary directory:",
"error": { "error": {
"create_temp_dir": "failed to create temporary directory", "no_manifest_tag": "no <link rel=\"manifest\"> tag found"
"download_failed": "failed to download PWA",
"fetch_manifest": "failed to fetch or parse manifest",
"fetch_url": "failed to fetch URL",
"no_manifest_tag": "no <link rel=\"manifest\"> tag found",
"read_response": "failed to read response body",
"write_index": "failed to write index.html"
}, },
"flag": { "flag": {
"url": "The URL of the PWA to build" "url": "The URL of the PWA to build"
@ -393,10 +359,7 @@
}, },
"dry_run_hint": "(dry-run) use --we-are-go-for-launch to publish", "dry_run_hint": "(dry-run) use --we-are-go-for-launch to publish",
"error": { "error": {
"determine_version": "failed to determine version", "no_publishers": "no publishers configured in .core/release.yaml"
"generate_changelog": "failed to generate changelog",
"no_publishers": "no publishers configured in .core/release.yaml",
"write_config": "failed to write config"
}, },
"flag": { "flag": {
"draft": "Create release as a draft", "draft": "Create release as a draft",
@ -456,8 +419,7 @@
"all": "Commit all dirty repos without prompting" "all": "Commit all dirty repos without prompting"
}, },
"long": "Uses Claude to create commits for dirty repos.\nShows uncommitted changes and invokes Claude to generate commit messages.", "long": "Uses Claude to create commits for dirty repos.\nShows uncommitted changes and invokes Claude to generate commit messages.",
"short": "Claude-assisted commits across repos", "short": "Claude-assisted commits across repos"
"success": "Committed successfully"
}, },
"committed": "committed", "committed": "committed",
"committing": "Committing", "committing": "Committing",
@ -531,7 +493,6 @@
"nothing": "Nothing to push", "nothing": "Nothing to push",
"pull_and_retry": "Pull changes and retry push?", "pull_and_retry": "Pull changes and retry push?",
"short": "Push commits across all repos", "short": "Push commits across all repos",
"success": "Pushed successfully",
"uncommitted_changes_commit": "You have uncommitted changes. Commit with Claude first?" "uncommitted_changes_commit": "You have uncommitted changes. Commit with Claude first?"
}, },
"repos_with_changes": "{{.Count}} repo(s) with uncommitted changes:", "repos_with_changes": "{{.Count}} repo(s) with uncommitted changes:",
@ -563,8 +524,7 @@
}, },
"sync": { "sync": {
"long": "This command scans the 'pkg' directory for services and ensures that the\ntop-level public API for each service is in sync with its internal implementation.\nIt automatically generates the necessary Go files with type aliases.", "long": "This command scans the 'pkg' directory for services and ensures that the\ntop-level public API for each service is in sync with its internal implementation.\nIt automatically generates the necessary Go files with type aliases.",
"short": "Synchronizes public service APIs with internal implementations", "short": "Synchronizes public service APIs with internal implementations"
"success": "Public APIs synchronized successfully."
}, },
"untracked": "{{.Count}} untracked", "untracked": "{{.Count}} untracked",
"vm": { "vm": {
@ -676,10 +636,6 @@
} }
}, },
"docs": { "docs": {
"error": {
"load_registry": "failed to load registry",
"scan_directory": "failed to scan directory"
},
"list": { "list": {
"coverage_summary": "{{.WithDocs}} with docs, {{.WithoutDocs}} without", "coverage_summary": "{{.WithDocs}} with docs, {{.WithoutDocs}} without",
"header": { "header": {
@ -745,7 +701,6 @@
"name": "pnpm" "name": "pnpm"
} }
}, },
"checking": "Checking development environment...",
"cli_auth": "CLI authenticated", "cli_auth": "CLI authenticated",
"cli_auth_missing": "CLI authentication - run: gh auth login", "cli_auth_missing": "CLI authentication - run: gh auth login",
"github": "GitHub Access:", "github": "GitHub Access:",
@ -782,10 +737,6 @@
"below_threshold": "FAIL Coverage {{.Actual}}% is below threshold {{.Threshold}}%", "below_threshold": "FAIL Coverage {{.Actual}}% is below threshold {{.Threshold}}%",
"error": { "error": {
"below_threshold": "coverage below threshold", "below_threshold": "coverage below threshold",
"create_file": "failed to create coverage file",
"discover": "failed to discover test packages",
"generate_html": "failed to generate HTML",
"get_coverage": "failed to get coverage",
"no_packages": "no test packages found" "no_packages": "no test packages found"
}, },
"flag": { "flag": {
@ -796,7 +747,6 @@
"html_label": "HTML:", "html_label": "HTML:",
"long": "Run tests and generate coverage report.\n\nExamples:\n core go cov # Run with coverage summary\n core go cov --html # Generate HTML report\n core go cov --open # Generate and open HTML report\n core go cov --threshold 80 # Fail if coverage < 80%", "long": "Run tests and generate coverage report.\n\nExamples:\n core go cov # Run with coverage summary\n core go cov --html # Generate HTML report\n core go cov --open # Generate and open HTML report\n core go cov --threshold 80 # Fail if coverage < 80%",
"open_manually": "(open manually)", "open_manually": "(open manually)",
"running": "Running tests with coverage",
"short": "Run tests with coverage report" "short": "Run tests with coverage report"
}, },
"fmt": { "fmt": {
@ -883,7 +833,6 @@
}, },
"long": "Run PHPStan or Larastan static analysis.\n\nAuto-detects Larastan if installed, otherwise uses PHPStan.", "long": "Run PHPStan or Larastan static analysis.\n\nAuto-detects Larastan if installed, otherwise uses PHPStan.",
"no_analyser": "no static analyser found (install PHPStan: composer require phpstan/phpstan --dev)", "no_analyser": "no static analyser found (install PHPStan: composer require phpstan/phpstan --dev)",
"running": "Running static analysis with {{.Analyser}}",
"short": "Run PHPStan static analysis" "short": "Run PHPStan static analysis"
}, },
"audit": { "audit": {
@ -904,7 +853,6 @@
"building_docker": "Building Docker image...", "building_docker": "Building Docker image...",
"building_linuxkit": "Building LinuxKit image...", "building_linuxkit": "Building LinuxKit image...",
"docker_run_with": "Run with:", "docker_run_with": "Run with:",
"docker_success": "Docker image built successfully",
"extensions": "Extensions:", "extensions": "Extensions:",
"flag": { "flag": {
"dockerfile": "Path to custom Dockerfile", "dockerfile": "Path to custom Dockerfile",
@ -919,7 +867,6 @@
"format": "Format:", "format": "Format:",
"frontend": "Frontend:", "frontend": "Frontend:",
"laravel": "Laravel:", "laravel": "Laravel:",
"linuxkit_success": "LinuxKit image built successfully",
"long": "Build a production-ready container image for the PHP project.\n\nBy default, builds a Docker image using FrankenPHP.\nUse --type linuxkit to build a LinuxKit VM image instead.", "long": "Build a production-ready container image for the PHP project.\n\nBy default, builds a Docker image using FrankenPHP.\nUse --type linuxkit to build a LinuxKit VM image instead.",
"octane": "Octane:", "octane": "Octane:",
"php_version": "PHP Version:", "php_version": "PHP Version:",
@ -935,7 +882,6 @@
}, },
"long": "Deploy the PHP application to Coolify.\n\nRequires configuration in .env:\n COOLIFY_URL=https://coolify.example.com\n COOLIFY_TOKEN=your-api-token\n COOLIFY_APP_ID=production-app-id\n COOLIFY_STAGING_APP_ID=staging-app-id (optional)", "long": "Deploy the PHP application to Coolify.\n\nRequires configuration in .env:\n COOLIFY_URL=https://coolify.example.com\n COOLIFY_TOKEN=your-api-token\n COOLIFY_APP_ID=production-app-id\n COOLIFY_STAGING_APP_ID=staging-app-id (optional)",
"short": "Deploy to Coolify", "short": "Deploy to Coolify",
"success": "Deployment completed successfully",
"triggered": "Deployment triggered. Use 'core php deploy:status' to check progress.", "triggered": "Deployment triggered. Use 'core php deploy:status' to check progress.",
"warning_status": "Deployment ended with status: {{.Status}}" "warning_status": "Deployment ended with status: {{.Status}}"
}, },
@ -958,12 +904,10 @@
"long": "Rollback to a previous deployment.\n\nIf no deployment ID is specified, rolls back to the most recent\nsuccessful deployment.", "long": "Rollback to a previous deployment.\n\nIf no deployment ID is specified, rolls back to the most recent\nsuccessful deployment.",
"rolling_back": "Rolling back {{.Environment}}...", "rolling_back": "Rolling back {{.Environment}}...",
"short": "Rollback to previous deployment", "short": "Rollback to previous deployment",
"success": "Rollback completed successfully",
"triggered": "Rollback triggered. Use 'core php deploy:status' to check progress.", "triggered": "Rollback triggered. Use 'core php deploy:status' to check progress.",
"warning_status": "Rollback ended with status: {{.Status}}" "warning_status": "Rollback ended with status: {{.Status}}"
}, },
"deploy_status": { "deploy_status": {
"checking": "Checking {{.Environment}} deployment status...",
"flag": { "flag": {
"id": "Specific deployment ID", "id": "Specific deployment ID",
"staging": "Check staging environment" "staging": "Check staging environment"
@ -983,7 +927,6 @@
"no_vite": "Skip Vite dev server", "no_vite": "Skip Vite dev server",
"port": "FrankenPHP port (default: 8000)" "port": "FrankenPHP port (default: 8000)"
}, },
"logs_failed": "Failed to get logs: {{.Error}}",
"long": "Starts all detected Laravel services.\n\nAuto-detects:\n - Vite (vite.config.js/ts)\n - Horizon (config/horizon.php)\n - Reverb (config/reverb.php)\n - Redis (from .env)", "long": "Starts all detected Laravel services.\n\nAuto-detects:\n - Vite (vite.config.js/ts)\n - Horizon (config/horizon.php)\n - Reverb (config/reverb.php)\n - Redis (from .env)",
"press_ctrl_c": "Press Ctrl+C to stop all services", "press_ctrl_c": "Press Ctrl+C to stop all services",
"services_started": "Services started:", "services_started": "Services started:",
@ -997,36 +940,24 @@
"audit_failed": "audit failed", "audit_failed": "audit failed",
"critical_high_issues": "critical or high severity issues found", "critical_high_issues": "critical or high severity issues found",
"deploy_failed": "deployment failed", "deploy_failed": "deployment failed",
"detect_config": "failed to detect project configuration",
"fmt_failed": "formatting failed", "fmt_failed": "formatting failed",
"fmt_issues": "formatting issues found", "fmt_issues": "formatting issues found",
"infection_failed": "mutation testing failed", "infection_failed": "mutation testing failed",
"infection_not_installed": "infection not installed", "infection_not_installed": "infection not installed",
"link_packages": "failed to link packages",
"list_deployments": "failed to list deployments",
"list_packages": "failed to list packages",
"mkcert_not_installed": "mkcert not installed", "mkcert_not_installed": "mkcert not installed",
"not_laravel": "not a Laravel project (missing artisan or laravel/framework)", "not_laravel": "not a Laravel project (missing artisan or laravel/framework)",
"not_laravel_short": "not a Laravel project", "not_laravel_short": "not a Laravel project",
"not_php": "not a PHP project (missing composer.json)", "not_php": "not a PHP project (missing composer.json)",
"open_shell": "failed to open shell",
"psalm_issues": "psalm found issues", "psalm_issues": "psalm found issues",
"psalm_not_installed": "psalm not installed", "psalm_not_installed": "psalm not installed",
"rector_failed": "rector failed", "rector_failed": "rector failed",
"rector_not_installed": "rector not installed", "rector_not_installed": "rector not installed",
"rollback_failed": "rollback failed", "rollback_failed": "rollback failed",
"security_failed": "security check failed", "security_failed": "security check failed",
"ssl_setup": "failed to setup SSL",
"start_container": "failed to start container",
"start_services": "failed to start services",
"status_failed": "failed to get status",
"stop_services": "failed to stop services",
"unlink_packages": "failed to unlink packages",
"update_packages": "composer update failed", "update_packages": "composer update failed",
"vulns_found": "vulnerabilities found" "vulns_found": "vulnerabilities found"
}, },
"fmt": { "fmt": {
"checking": "Checking code with {{.Formatter}}",
"flag": { "flag": {
"fix": "Auto-fix formatting issues" "fix": "Auto-fix formatting issues"
}, },
@ -1034,8 +965,7 @@
"long": "Format PHP code using Laravel Pint.", "long": "Format PHP code using Laravel Pint.",
"no_formatter": "no formatter found (install Laravel Pint: composer require laravel/pint --dev)", "no_formatter": "no formatter found (install Laravel Pint: composer require laravel/pint --dev)",
"no_issues": "No formatting issues found", "no_issues": "No formatting issues found",
"short": "Format PHP code with Laravel Pint", "short": "Format PHP code with Laravel Pint"
"success": "Code formatted successfully"
}, },
"infection": { "infection": {
"complete": "Mutation testing complete", "complete": "Mutation testing complete",
@ -1050,7 +980,6 @@
"long": "Run Infection mutation testing to measure test suite quality.\n\nMutation testing modifies your code and checks if tests catch\nthe changes. High mutation score = high quality tests.\n\nWarning: This can be slow on large codebases.", "long": "Run Infection mutation testing to measure test suite quality.\n\nMutation testing modifies your code and checks if tests catch\nthe changes. High mutation score = high quality tests.\n\nWarning: This can be slow on large codebases.",
"not_found": "Infection not found", "not_found": "Infection not found",
"note": "This may take a while...", "note": "This may take a while...",
"running": "Running mutation testing",
"short": "Mutation testing for test quality" "short": "Mutation testing for test quality"
}, },
"label": { "label": {
@ -1148,7 +1077,6 @@
"no_checks": "No checks available", "no_checks": "No checks available",
"passed": "passed", "passed": "passed",
"pipeline_failed": "QA pipeline failed", "pipeline_failed": "QA pipeline failed",
"running": "Running QA pipeline ({{.Stages}})",
"short": "Run full QA pipeline", "short": "Run full QA pipeline",
"some_failed": "Some checks failed ({{.Passed}}/{{.Total}} passed)", "some_failed": "Some checks failed ({{.Passed}}/{{.Total}} passed)",
"stage_prefix": "═══ ", "stage_prefix": "═══ ",
@ -1167,7 +1095,6 @@
"long": "Run Rector for automated code improvements and PHP upgrades.\n\nRector can automatically upgrade PHP syntax, improve code quality,\nand apply framework-specific refactorings.", "long": "Run Rector for automated code improvements and PHP upgrades.\n\nRector can automatically upgrade PHP syntax, improve code quality,\nand apply framework-specific refactorings.",
"no_changes": "No changes needed", "no_changes": "No changes needed",
"not_found": "Rector not found", "not_found": "Rector not found",
"refactored": "Code refactored successfully",
"refactoring": "Refactoring code with Rector", "refactoring": "Refactoring code with Rector",
"setup": "./vendor/bin/rector init", "setup": "./vendor/bin/rector init",
"short": "Automated code refactoring" "short": "Automated code refactoring"
@ -1185,7 +1112,6 @@
"low": "Low:", "low": "Low:",
"medium": "Medium:", "medium": "Medium:",
"passed": "Passed:", "passed": "Passed:",
"running": "Running security checks",
"short": "Security vulnerability scanning", "short": "Security vulnerability scanning",
"summary": "Security scan complete" "summary": "Security scan complete"
}, },
@ -1201,7 +1127,6 @@
"long": "Run a production PHP container.\n\nThis starts the built Docker image in production mode.", "long": "Run a production PHP container.\n\nThis starts the built Docker image in production mode.",
"name_required": "--name is required: specify the Docker image name", "name_required": "--name is required: specify the Docker image name",
"ports": "Ports:", "ports": "Ports:",
"running": "Running production container...",
"short": "Run production container", "short": "Run production container",
"stopped": "Container stopped" "stopped": "Container stopped"
}, },
@ -1252,20 +1177,16 @@
"parallel": "Run tests in parallel" "parallel": "Run tests in parallel"
}, },
"long": "Run PHP tests using PHPUnit or Pest.\n\nAuto-detects Pest if tests/Pest.php exists, otherwise uses PHPUnit.", "long": "Run PHP tests using PHPUnit or Pest.\n\nAuto-detects Pest if tests/Pest.php exists, otherwise uses PHPUnit.",
"running": "Running tests with {{.Runner}}",
"short": "Run PHP tests (PHPUnit/Pest)" "short": "Run PHP tests (PHPUnit/Pest)"
} }
}, },
"pkg": { "pkg": {
"error": { "error": {
"auth_failed": "authentication failed - try: unset GH_TOKEN && gh auth login", "auth_failed": "authentication failed - try: unset GH_TOKEN && gh auth login",
"create_directory": "failed to create directory: %w",
"gh_not_authenticated": "gh CLI not authenticated. Run: gh auth login", "gh_not_authenticated": "gh CLI not authenticated. Run: gh auth login",
"invalid_repo_format": "invalid repo format: use org/repo (e.g., host-uk/core-php)", "invalid_repo_format": "invalid repo format: use org/repo (e.g., host-uk/core-php)",
"load_registry": "failed to load registry: %w",
"no_repos_yaml": "no repos.yaml found", "no_repos_yaml": "no repos.yaml found",
"no_repos_yaml_workspace": "no repos.yaml found - run from workspace directory", "no_repos_yaml_workspace": "no repos.yaml found - run from workspace directory",
"parse_results": "failed to parse results: %w",
"repo_required": "repository is required (e.g., core pkg install host-uk/core-php)", "repo_required": "repository is required (e.g., core pkg install host-uk/core-php)",
"search_failed": "search failed: %s", "search_failed": "search failed: %s",
"specify_package": "specify package name or use --all" "specify_package": "specify package name or use --all"
@ -1337,7 +1258,6 @@
"diff": { "diff": {
"base_label": "Base:", "base_label": "Base:",
"breaking": "Breaking:", "breaking": "Breaking:",
"checking": "Checking for breaking changes",
"error": { "error": {
"base_required": "--base is required (version tag or file path)" "base_required": "--base is required (version tag or file path)"
}, },
@ -1391,7 +1311,6 @@
"setting_up": "Setting up repository", "setting_up": "Setting up repository",
"would_create": "Would create" "would_create": "Would create"
}, },
"running_build": "Running build...",
"short": "Bootstrap workspace or clone packages from registry", "short": "Bootstrap workspace or clone packages from registry",
"to_clone": "{{.Count}} to clone", "to_clone": "{{.Count}} to clone",
"wizard": { "wizard": {
@ -1434,21 +1353,13 @@
}, },
"vm": { "vm": {
"error": { "error": {
"apply_template": "failed to apply template",
"build_image": "failed to build image",
"create_temp": "failed to create temp directory",
"id_and_cmd_required": "container ID and command are required", "id_and_cmd_required": "container ID and command are required",
"id_required": "container ID is required", "id_required": "container ID is required",
"init_manager": "failed to initialize container manager",
"linuxkit_not_found": "linuxkit not found. Install with: brew install linuxkit (macOS) or see https://github.com/linuxkit/linuxkit", "linuxkit_not_found": "linuxkit not found. Install with: brew install linuxkit (macOS) or see https://github.com/linuxkit/linuxkit",
"list_containers": "failed to list containers",
"multiple_match": "multiple containers match '{{.ID}}', be more specific", "multiple_match": "multiple containers match '{{.ID}}', be more specific",
"no_image_found": "no image found after build", "no_image_found": "no image found after build",
"no_match": "no container found matching: {{.ID}}", "no_match": "no container found matching: {{.ID}}",
"run_container": "failed to run container", "template_required": "template name is required"
"stop_container": "failed to stop container",
"template_required": "template name is required",
"write_template": "failed to write template"
}, },
"exec": { "exec": {
"long": "Execute a command inside a running VM via SSH.\n\nExamples:\n core vm exec abc12345 ls -la\n core vm exec abc1 /bin/sh", "long": "Execute a command inside a running VM via SSH.\n\nExamples:\n core vm exec abc12345 ls -la\n core vm exec abc1 /bin/sh",