package console import ( "strconv" "strings" ) // StatusCopy is filled only with language approved through the repository's // copy-review gate. Keeping the structural status work independent lets its // state transitions and tests land without smuggling draft prose into the UI. type StatusCopy struct { ObservedLabel string ReportingCount string Mixed string NoInstances string NoVersion string Partial string Next string } var approvedStatusCopy = StatusCopy{ ObservedLabel: "Observed versions", ReportingCount: "{reported} of {total} instances report a version.", Mixed: "Multiple versions", NoInstances: "No instances yet.", NoVersion: "No instances have reported a version yet.", Partial: "Some instances have not reported a version.", Next: "Candidate for promotion: {version}.", } func (d DeploymentStatus) ReportingText() string { return strings.NewReplacer( "{reported}", strconv.Itoa(d.ReportedCount), "{total}", strconv.Itoa(d.ReportableCount), ).Replace(approvedStatusCopy.ReportingCount) } func (s ReleaseSummary) CandidateText() string { return strings.ReplaceAll(approvedStatusCopy.Next, "{version}", s.NextVersion) }