[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find features de... #152

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-i18n-rfc-md-ful into dev 2026-04-02 07:24:02 +00:00
2 changed files with 31 additions and 0 deletions

View file

@ -915,6 +915,7 @@ func ActionFailed(verb, subject string) string {
if verb == "" {
return ""
}
verb = renderWord(currentLangForGrammar(), verb)
if subject == "" {
return "Failed to " + verb
}

View file

@ -811,6 +811,36 @@ func TestActionFailed(t *testing.T) {
}
}
func TestActionFailed_RespectsWordMap(t *testing.T) {
prev := Default()
svc, err := New()
if err != nil {
t.Fatalf("New() failed: %v", err)
}
SetDefault(svc)
t.Cleanup(func() {
SetDefault(prev)
})
data := GetGrammarData("en")
if data == nil {
t.Fatal("GetGrammarData(\"en\") returned nil")
}
original, existed := data.Words["push"]
data.Words["push"] = "submit"
t.Cleanup(func() {
if existed {
data.Words["push"] = original
return
}
delete(data.Words, "push")
})
if got, want := ActionFailed("push", "commits"), "Failed to submit commits"; got != want {
t.Fatalf("ActionFailed(%q, %q) = %q, want %q", "push", "commits", got, want)
}
}
func TestGrammarData_Signals(t *testing.T) {
svc, err := New()
if err != nil {