[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/i18n/RFC.md fully. Find features de... #201
2 changed files with 19 additions and 0 deletions
|
|
@ -938,7 +938,9 @@ func TemplateFuncs() template.FuncMap {
|
|||
"plural": Pluralize,
|
||||
"pluralForm": PluralForm,
|
||||
"article": ArticlePhrase,
|
||||
"articlePhrase": ArticlePhrase,
|
||||
"definite": DefinitePhrase,
|
||||
"definitePhrase": DefinitePhrase,
|
||||
"quote": Quote,
|
||||
"label": Label,
|
||||
"progress": Progress,
|
||||
|
|
|
|||
|
|
@ -1110,6 +1110,9 @@ func TestTemplateFuncs(t *testing.T) {
|
|||
"plural",
|
||||
"pluralForm",
|
||||
"article",
|
||||
"articlePhrase",
|
||||
"definite",
|
||||
"definitePhrase",
|
||||
"quote",
|
||||
"label",
|
||||
"progress",
|
||||
|
|
@ -1142,6 +1145,20 @@ func TestTemplateFuncs_Article(t *testing.T) {
|
|||
if got, want := buf.String(), "an apple"; got != want {
|
||||
t.Fatalf("template article = %q, want %q", got, want)
|
||||
}
|
||||
|
||||
tmpl, err = template.New("").Funcs(TemplateFuncs()).Parse(`{{articlePhrase "apple"}}|{{definitePhrase "apple"}}`)
|
||||
if err != nil {
|
||||
t.Fatalf("Parse() alias helpers failed: %v", err)
|
||||
}
|
||||
|
||||
buf.Reset()
|
||||
if err := tmpl.Execute(&buf, nil); err != nil {
|
||||
t.Fatalf("Execute() alias helpers failed: %v", err)
|
||||
}
|
||||
|
||||
if got, want := buf.String(), "an apple|the apple"; got != want {
|
||||
t.Fatalf("template article aliases = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTemplateFuncs_CompositeHelpers(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue