oficina / docs Public

us-english: the one word in the UI that disagreed with the three names for the same thing closed

On branch us-english

One string and one guard, from Paul's ruling on discussion 31: the UI is US English until a profile locale offers the choice.

What was wrong

The alignment buttons read "Align left / Align centre / Align right". The label was the only place in the whole feature that spelled it that way — align_center is the command, docs-align-center the class, and text-align: center the CSS keyword that makes it happen. Three names agreed and the one a person actually reads did not.

What changed

docs.editor.toolbar.align.center now reads "Align center". That is the entire product change; the catalog was scanned for every other British spelling and there were none in anything a user reads.

Two near-misses I checked and left alone:

  • internal/fonts' Licence() and its comment. British, but a Go identifier and a panic string, not copy — and the path it serves is already LICENSE-OFL-1.1.txt.
  • fixtures/toolbar.mjs's comment citing align_center: 'centre' as the bug a guard once missed. That is an illustration of a wrong value, and it stays correct — arguably more legible now that the right value is unambiguous.

The guard

Nothing was checking which English the catalog was in, so the same drift could land again the moment someone adds a string. TestTheCatalogIsWrittenInUSEnglish walks every value and flags British forms against a word list.

A word list rather than a speller, deliberately: a dictionary is a dependency and a reliable source of false positives on product nouns, whereas the ~30 pairs a UK-based writer actually reaches for cost nothing and cannot misfire. Derived forms are listed rather than stemmed — a suffix rule for -ise turns "premise" into a finding, and a list that misses "colourless" until someone writes it is the better failure.

Tokenisation splits on non-letters, so "couldn't" becomes "couldn"/"t" rather than hiding a word glued to punctuation where an exact-match lookup would never see it.

Verified against the mistake, not just against itself — this project has found nine tests unable to fail, so the check is the point. The defect was put back, and the test failed naming both the key and the word:

render_test.go:133: docs.editor.toolbar.align.center: "centre" is British English — write "center"

Then removed again, and it passes.

Not this branch

Discussion 31: the locale on the profile. When en-GB exists as a second table, "Align centre" becomes its entry and this guard moves onto the en-US one. This branch is explicitly not a substitute for that and does not constrain its design.

Go suite green across all six packages.

Merged as d20a813 and live: x-carlos-version: d20a813 read off the real host, and the binary carries "Align center" with no "Align centre" anywhere in it (checked with grep -a — plain grep suppresses binary matches and had silently reported nothing, which is the shape of check this project keeps catching).

The guard is in CI now and passed there, not only on my machine.

Closing. Discussion 31 holds the locale work this defers to.