[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find ONE feature... #51

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-i18n-rfc-md-ful into dev 2026-04-01 23:46:13 +00:00
6 changed files with 20 additions and 11 deletions

View file

@ -194,7 +194,7 @@ T("i18n.count.person", 3) // "3 people"
Produces past-tense completion messages.
```go
T("i18n.done.delete", "config.yaml") // "Config.Yaml deleted"
T("i18n.done.delete", "config.yaml") // "Config.yaml deleted"
T("i18n.done.push", "commits") // "Commits pushed"
T("i18n.done.delete") // "Deleted"
```

View file

@ -621,18 +621,26 @@ func isVowel(r rune) bool {
return false
}
// Title capitalises the first letter of each word.
// Title capitalises the first letter of each word-like segment.
//
// Hyphens and whitespace start a new segment; punctuation inside identifiers
// such as dots and underscores is preserved so filenames stay readable.
func Title(s string) string {
b := core.NewBuilder()
b.Grow(len(s))
prev := ' '
capNext := true
for _, r := range s {
if !unicode.IsLetter(prev) && unicode.IsLetter(r) {
if unicode.IsLetter(r) && capNext {
b.WriteRune(unicode.ToUpper(r))
} else {
b.WriteRune(r)
}
prev = r
switch r {
case ' ', '\t', '\n', '\r', '-':
capNext = true
default:
capNext = false
}
}
return b.String()
}

View file

@ -454,6 +454,7 @@ func TestTitle(t *testing.T) {
{"", ""},
{"HELLO", "HELLO"},
{"hello-world", "Hello-World"},
{"config.yaml", "Config.yaml"},
}
for _, tt := range tests {
@ -663,7 +664,7 @@ func TestActionResult(t *testing.T) {
verb, subject string
want string
}{
{"delete", "config.yaml", "Config.Yaml deleted"},
{"delete", "config.yaml", "Config.yaml deleted"},
{"build", "project", "Project built"},
{"", "file", ""},
{"delete", "", ""},

View file

@ -104,8 +104,8 @@ func TestDoneHandler(t *testing.T) {
// With subject
got := h.Handle("i18n.done.delete", []any{"config.yaml"}, nil)
if got != "Config.Yaml deleted" {
t.Errorf("DoneHandler.Handle(delete, config.yaml) = %q, want %q", got, "Config.Yaml deleted")
if got != "Config.yaml deleted" {
t.Errorf("DoneHandler.Handle(delete, config.yaml) = %q, want %q", got, "Config.yaml deleted")
}
// Without subject — just past tense

View file

@ -54,8 +54,8 @@ func TestServiceT(t *testing.T) {
// Done handler
got = svc.T("i18n.done.delete", "config.yaml")
if got != "Config.Yaml deleted" {
t.Errorf("T(i18n.done.delete, config.yaml) = %q, want 'Config.Yaml deleted'", got)
if got != "Config.yaml deleted" {
t.Errorf("T(i18n.done.delete, config.yaml) = %q, want 'Config.yaml deleted'", got)
}
// Fail handler

View file

@ -8,7 +8,7 @@
// T("i18n.label.status") // "Status:"
// T("i18n.progress.build") // "Building..."
// T("i18n.count.file", 5) // "5 files"
// T("i18n.done.delete", "config.yaml") // "Config.Yaml deleted"
// T("i18n.done.delete", "config.yaml") // "Config.yaml deleted"
// T("i18n.fail.push", "commits") // "Failed to push commits"
package i18n