The catalog is in US English, and now says so in a test
"Align centre" was the only British spelling in anything a user reads. It was also the one word in the feature that disagreed with itself: the command is align_center, the class is docs-align-center, and the CSS keyword is text-align: center. Only the label spelled it the other way. Paul's answer to the underlying question is a locale on the profile offering both englishes, filed as discussion 31 — this is not that, and does not pre-empt it. When en-GB exists as a second table, "Align centre" is its entry and the guard below moves to the en-US one. The guard is a word list, not a dictionary. A speller is a dependency and a source of false positives on product nouns; a list of the pairs a UK-based writer actually reaches for costs nothing and fails loudly. It was verified the way this project has learned to verify a test: the defect was put back, the test named the key and the word, and the defect was removed again.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2 files changed,
+82
−1
internal/docs/render.go+1 −1internal/docs/render_test.go+81 −0
CI passed — run details
Intent
Attributed to this commit: 139 g CO₂e (15732355 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on us-english, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/docs/render.go b/internal/docs/render.go| index 704689e..e18cbe5 100644 |
| --- a/internal/docs/render.go |
| +++ b/internal/docs/render.go |
| @@ -251,7 +251,7 @@ var Catalog = rastrillo.Catalog{ |
| // "Align left" and not "Left": the name is read on its own by a |
| // screen reader, out of any row, and "Left" answers no question. |
| "docs.editor.toolbar.align.left": "Align left", |
| - "docs.editor.toolbar.align.center": "Align centre", |
| + "docs.editor.toolbar.align.center": "Align center", |
| "docs.editor.toolbar.align.right": "Align right", |
| // docs.editor.menu.* — the menu bar (show.html's [docs-menubar], |
diff --git a/internal/docs/render_test.go b/internal/docs/render_test.go| index e6bcc77..fa8215a 100644 |
| --- a/internal/docs/render_test.go |
| +++ b/internal/docs/render_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "io/fs" |
| "strings" |
| "testing" |
| + "unicode" |
| ) |
| // TestOurTemplatesUseTheAttributeGrammar holds the markup constraint |
| @@ -54,3 +55,83 @@ func TestOurTemplatesUseTheAttributeGrammar(t *testing.T) { |
| t.Fatalf("walk viewsFS: %v", err) |
| } |
| } |
| + |
| +// The catalog is written in US English, per Paul's ruling on 2026-09-03. |
| +// It reached this rule by shipping the counterexample: the alignment |
| +// buttons read "Align centre" while the command, the CSS class and the |
| +// keyword `text-align` itself all say `center`, so the label disagreed |
| +// with every other name for the same thing — and with the person who |
| +// asked for the feature. |
| +// |
| +// The real answer is a locale on the profile offering both spellings |
| +// (discussion 31), which this test does not pre-empt: when that lands, |
| +// en-GB is a second table and this guard moves to the en-US one. Until |
| +// then there is exactly one table, and nothing else was checking which |
| +// English it was written in. |
| +// |
| +// It is deliberately a word list rather than a dictionary. A general |
| +// speller is a dependency and a source of false positives on product |
| +// nouns; the pairs below are the ones a UK-based writer actually |
| +// reaches for, and a miss costs one wrong word that the next addition |
| +// to the list catches. Each entry is a British form whose US form |
| +// differs — never a word that is merely uncommon. |
| +func TestTheCatalogIsWrittenInUSEnglish(t *testing.T) { |
| + // British form -> the US form it should have been. The value is |
| + // never used to rewrite anything; it is there so a failure tells |
| + // the reader what to write instead of only that something is |
| + // wrong. Derived forms are listed rather than stemmed, because a |
| + // suffix rule that turns "premise" into a finding is worse than |
| + // a list that misses "colourless" until someone writes it. |
| + british := map[string]string{ |
| + "centre": "center", |
| + "centred": "centered", |
| + "centres": "centers", |
| + "colour": "color", |
| + "colours": "colors", |
| + "coloured": "colored", |
| + "behaviour": "behavior", |
| + "behaviours": "behaviors", |
| + "licence": "license", |
| + "defence": "defense", |
| + "grey": "gray", |
| + "catalogue": "catalog", |
| + "dialogue": "dialog", |
| + "favourite": "favorite", |
| + "favourites": "favorites", |
| + "cancelled": "canceled", |
| + "cancelling": "canceling", |
| + "customise": "customize", |
| + "customised": "customized", |
| + "organise": "organize", |
| + "organised": "organized", |
| + "organising": "organizing", |
| + "recognise": "recognize", |
| + "recognised": "recognized", |
| + "initialise": "initialize", |
| + "analyse": "analyze", |
| + "analysed": "analyzed", |
| + "apologise": "apologize", |
| + "programme": "program", |
| + "whilst": "while", |
| + "towards": "toward", |
| + } |
| + |
| + // Words, lowercased, with anything that is not a letter treated as |
| + // a separator: the catalog's values carry apostrophes, ellipses and |
| + // ordinary punctuation, and "couldn't" has to split into "couldn" |
| + // and "t" rather than leaving a word glued to a mark and invisible |
| + // to an exact-match lookup. |
| + words := func(s string) []string { |
| + return strings.FieldsFunc(strings.ToLower(s), func(r rune) bool { |
| + return !unicode.IsLetter(r) |
| + }) |
| + } |
| + |
| + for key, value := range Catalog { |
| + for _, w := range words(value) { |
| + if us, ok := british[w]; ok { |
| + t.Errorf("%s: %q is British English — write %q (this catalog is en-US; see discussion 31)", key, w, us) |
| + } |
| + } |
| + } |
| +} |