oficina / fichas Public

Phase 1 review, round 2: Fable's lows

- The template check reads every action, so a locale call after with,
  if, range or a pipe must name the reader's localizer too.
- A route test posts a CRLF form over LF notes; the line-ending rule
  lives in one place, EditFields.
- A <time> whose text is a date in the reader's locale carries its lang.
- History offers no Restore that only differs by line endings.
- Build notes 20 to 22; the new strings collected for copy review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev df05b604b090731ca7f53f912da5635e428359a9 parent 68feb3d
11 files changed, +1,031 −22
  • copy-review/level-up-phase-1/strings.json +938 −0
  • docs/superpowers/specs/2026-11-17-fichas-level-up.md +3 −0
  • internal/fichas/card_handlers.go +1 −1
  • internal/fichas/edit_handlers.go +4 −2
  • internal/fichas/render.go +36 −6
  • internal/fichas/templates/card_layout.html +1 −1
  • internal/fichas/templates/history.html +2 −2
  • internal/fichas/templates/index.html +3 −3
  • internal/fichas/templates/partials.html +3 −3
  • internal/fichastest/edit_routes_test.go +30 −2
  • internal/fichastest/formats_markup_test.go +10 −2

CI passed — run details

CI log
=== vet ===
go vet ./...
go vet -tags browser ./internal/fichastest/
=== fmt ===
=== test ===
go test ./...
?   	amadan.net/oficina/fichas/cmd/fichas	[no test files]
ok  	amadan.net/oficina/fichas/internal/fichas	2.600s
?   	amadan.net/oficina/fichas/internal/fichas/icons	[no test files]
ok  	amadan.net/oficina/fichas/internal/fichas/locale	0.009s
ok  	amadan.net/oficina/fichas/internal/fichas/seal	(cached)
ok  	amadan.net/oficina/fichas/internal/fichastest	2.133s
?   	amadan.net/oficina/fichas/scripts/mockups	[no test files]
?   	amadan.net/oficina/fichas/scripts/preview	[no test files]
?   	amadan.net/oficina/fichas/scripts/writeestilo	[no test files]
=== migration-check ===
go tool rastrillo migration check
rastrillo migration check: models and migrations agree
diff --git a/copy-review/level-up-phase-1/strings.json b/copy-review/level-up-phase-1/strings.json
new file mode 100644
index 0000000..ea51dfd
--- /dev/null
+++ b/copy-review/level-up-phase-1/strings.json
@@ -0,0 +1,938 @@
+[
+ {
+ "id": "menu.title.card",
+ "section": "The bar and its menus",
+ "label": "Menu title",
+ "text": "Card",
+ "context": "The menu bar under the title in the stacked header (spec §3.1).",
+ "notes": ""
+ },
+ {
+ "id": "menu.title.edit",
+ "section": "The bar and its menus",
+ "label": "Menu title",
+ "text": "Edit",
+ "context": "The menu bar under the title in the stacked header (spec §3.1).",
+ "notes": ""
+ },
+ {
+ "id": "menu.title.view",
+ "section": "The bar and its menus",
+ "label": "Menu title",
+ "text": "View",
+ "context": "The menu bar under the title in the stacked header (spec §3.1).",
+ "notes": ""
+ },
+ {
+ "id": "menu.title.type",
+ "section": "The bar and its menus",
+ "label": "Menu title",
+ "text": "Type",
+ "context": "The menu bar under the title in the stacked header (spec §3.1).",
+ "notes": ""
+ },
+ {
+ "id": "menu.title.help",
+ "section": "The bar and its menus",
+ "label": "Menu title",
+ "text": "Help",
+ "context": "The menu bar under the title in the stacked header (spec §3.1).",
+ "notes": ""
+ },
+ {
+ "id": "menu.card.new",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "New {singular}",
+ "context": "Card menu; {singular} is the type's name in lower case: 'New customer'. Also the bar's primary button.",
+ "notes": ""
+ },
+ {
+ "id": "menu.card.full",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Open full page",
+ "context": "Card menu, when a card is open beside the list.",
+ "notes": ""
+ },
+ {
+ "id": "menu.card.history",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "History",
+ "context": "Card menu and a bar button, when a card is open.",
+ "notes": ""
+ },
+ {
+ "id": "menu.card.delete",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Delete…",
+ "context": "Card menu, in the danger tone; opens the existing confirm page.",
+ "notes": ""
+ },
+ {
+ "id": "menu.edit.undo",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Undo",
+ "context": "Edit menu, with ⌘Z beside it. Undoes this tab's last change.",
+ "notes": ""
+ },
+ {
+ "id": "menu.edit.redo",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Redo",
+ "context": "Edit menu, with ⇧⌘Z beside it.",
+ "notes": ""
+ },
+ {
+ "id": "menu.view.table",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Table",
+ "context": "View menu.",
+ "notes": ""
+ },
+ {
+ "id": "menu.view.cards",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Cards",
+ "context": "View menu.",
+ "notes": ""
+ },
+ {
+ "id": "menu.view.comfortable",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Comfortable",
+ "context": "View menu: row density.",
+ "notes": ""
+ },
+ {
+ "id": "menu.view.compact",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Compact",
+ "context": "View menu: row density.",
+ "notes": ""
+ },
+ {
+ "id": "menu.view.fold",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Fold rail",
+ "context": "View menu and the rail's foot, with ⌘\\ beside it.",
+ "notes": ""
+ },
+ {
+ "id": "menu.view.unfold",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Unfold rail",
+ "context": "View menu and the rail's foot when it is folded.",
+ "notes": ""
+ },
+ {
+ "id": "menu.type.fields",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Fields",
+ "context": "Type menu.",
+ "notes": ""
+ },
+ {
+ "id": "menu.type.layout",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Card layout",
+ "context": "Type menu.",
+ "notes": ""
+ },
+ {
+ "id": "menu.type.new",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "New type",
+ "context": "Type menu and the rail.",
+ "notes": ""
+ },
+ {
+ "id": "menu.help.keys",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Keyboard shortcuts",
+ "context": "Help menu; opens the keys dialog.",
+ "notes": ""
+ },
+ {
+ "id": "bar.search",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Search",
+ "context": "Bar button; focuses the list's Find box (⌘K).",
+ "notes": ""
+ },
+ {
+ "id": "bar.saved",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Saved",
+ "context": "The save state in the bar's lead slot.",
+ "notes": ""
+ },
+ {
+ "id": "bar.saving",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Saving…",
+ "context": "The save state while a change is on its way.",
+ "notes": ""
+ },
+ {
+ "id": "bar.failed",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Couldn't save",
+ "context": "The save state when a change did not reach Fichas.",
+ "notes": ""
+ },
+ {
+ "id": "bar.state.label",
+ "section": "The bar and its menus",
+ "label": "Menu item or bar text",
+ "text": "Save state",
+ "context": "The save state's accessible name.",
+ "notes": ""
+ },
+ {
+ "id": "keys.title",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Keyboard shortcuts",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.move",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Move between cells",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.enter",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Change the cell; in a cell, save and move down",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.typing.key",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Typing",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.typing",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Replace the cell's value with what you type",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.esc",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Cancel a change; again, leave the table",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.delete",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Clear the cell",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.tab",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "In a cell, save and move right",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.undo",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Undo and redo your changes",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.jk",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Next and previous card, beside the list",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.search",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Search",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.fold",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Fold the rail",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "keys.close",
+ "section": "Keyboard shortcuts dialog",
+ "label": "Dialog text",
+ "text": "Close",
+ "context": "Help › Keyboard shortcuts.",
+ "notes": ""
+ },
+ {
+ "id": "table.help",
+ "section": "The table",
+ "label": "Line under the table",
+ "text": "Click a cell to change it; the name opens the card beside the list.",
+ "context": "Under every table (spec §5.1).",
+ "notes": ""
+ },
+ {
+ "id": "table.cell.sr",
+ "section": "The table",
+ "label": "Screen-reader text in a cell",
+ "text": ", change {field}",
+ "context": "Read after a cell's value: 'ana@example.com, change Email'.",
+ "notes": ""
+ },
+ {
+ "id": "table.outofview",
+ "section": "The table",
+ "label": "Mark on an edited row",
+ "text": "No longer in this view",
+ "context": "Beside the name, with an icon, when an edit takes the card out of the list (§5.1). Also announced.",
+ "notes": ""
+ },
+ {
+ "id": "table.picker.find",
+ "section": "The table",
+ "label": "A Choice picker's search box label",
+ "text": "Find {field}",
+ "context": "Accessible name of the picker's search box.",
+ "notes": ""
+ },
+ {
+ "id": "table.picker.none",
+ "section": "The table",
+ "label": "A Choice picker's first option",
+ "text": "No {field}",
+ "context": "Clears the Choice; {field} in lower case: 'No stage'.",
+ "notes": ""
+ },
+ {
+ "id": "table.choice.retired",
+ "section": "The table",
+ "label": "A stored option no longer offered",
+ "text": "{value} (no longer offered)",
+ "context": "In a Choice's select on the forms, so saving another field keeps it.",
+ "notes": ""
+ },
+ {
+ "id": "toast.changed",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "{field} changed to {value}.",
+ "context": "After a save; {value} in the reader's format.",
+ "notes": ""
+ },
+ {
+ "id": "toast.cleared",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "{field} cleared.",
+ "context": "After clearing a value.",
+ "notes": ""
+ },
+ {
+ "id": "toast.undo",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Undo",
+ "context": "The toast's button, for 10 seconds.",
+ "notes": ""
+ },
+ {
+ "id": "toast.undone",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Undone.",
+ "context": "After Undo.",
+ "notes": ""
+ },
+ {
+ "id": "toast.redone",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Redone.",
+ "context": "After Redo (⇧⌘Z).",
+ "notes": ""
+ },
+ {
+ "id": "toast.nothing",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Nothing to undo.",
+ "context": "An Undo that found everything changed again.",
+ "notes": ""
+ },
+ {
+ "id": "toast.left.gone",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "{field}'s old value can no longer be used, so it was left.",
+ "context": "An Undo that could not put back an option since removed.",
+ "notes": ""
+ },
+ {
+ "id": "toast.left.by",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "{field} was changed again by {name}, so it was left.",
+ "context": "{name} is the part of their address before @ until rosters carry names.",
+ "notes": ""
+ },
+ {
+ "id": "toast.left",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "{field} was changed again, so it was left.",
+ "context": "As above, by Fichas itself.",
+ "notes": ""
+ },
+ {
+ "id": "toast.undo.gone",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "That can no longer be undone.",
+ "context": "⌘Z on an event past the value window or not this person's.",
+ "notes": ""
+ },
+ {
+ "id": "toast.undo.offline",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Couldn't reach Fichas, so nothing was undone.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "toast.undo.empty",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Nothing to undo in this tab.",
+ "context": "⌘Z with no change made in this tab.",
+ "notes": ""
+ },
+ {
+ "id": "toast.redo.empty",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "Nothing to redo.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "toast.gone",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "That can't be changed any more.",
+ "context": "A save answered 404: the card was deleted meanwhile.",
+ "notes": ""
+ },
+ {
+ "id": "live.undo",
+ "section": "Toasts and the live region",
+ "label": "Toast",
+ "text": "{message} Undo is available.",
+ "context": "Read by screen readers with a toast that offers Undo.",
+ "notes": ""
+ },
+ {
+ "id": "error.offline.cell",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Couldn't save. Check your connection, then press Enter to try again.",
+ "context": "Beside a cell's editor.",
+ "notes": ""
+ },
+ {
+ "id": "error.offline.sheet",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Couldn't save. Check your connection and try again.",
+ "context": "In the phone's sheet.",
+ "notes": ""
+ },
+ {
+ "id": "error.reenter",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Enter the value again.",
+ "context": "A posted page locale Fichas does not offer (§6.8).",
+ "notes": ""
+ },
+ {
+ "id": "error.number",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Enter a number, like {example}.",
+ "context": "{example} is 1200.5 written the reader's way: '1200,5' in German.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.someone",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "{name} changed this to {value}.",
+ "context": "A 409: someone saved first (§5.2).",
+ "notes": ""
+ },
+ {
+ "id": "conflict.you",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "You changed this to {value} in another tab.",
+ "context": "The last change was this person's own.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.cleared",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "{name} cleared this.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "conflict.cleared.you",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "You cleared this in another tab.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "conflict.keep",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Keep theirs",
+ "context": "Button beside a conflict.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.mine",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Use mine",
+ "context": "Button beside a conflict; saves again over theirs.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.sheet",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "{message} Save again to use yours.",
+ "context": "The phone's sheet.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.page.callout",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Someone changed a field while you were editing, so nothing was saved. Choose which value to keep for each, then save again.",
+ "context": "The scriptless edit form's 409 page; 'some fields' when several.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.page.theirs",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Keep theirs: {value} ({name}'s)",
+ "context": "A radio button.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.page.mine",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "Use mine: {value}",
+ "context": "A radio button.",
+ "notes": ""
+ },
+ {
+ "id": "conflict.page.nothing",
+ "section": "Refusals and conflicts",
+ "label": "Message",
+ "text": "nothing",
+ "context": "{value} when a side is empty.",
+ "notes": ""
+ },
+ {
+ "id": "notice.saved",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Saved.",
+ "context": "With an Undo button.",
+ "notes": ""
+ },
+ {
+ "id": "notice.undone",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Undone.",
+ "context": "With a Redo button.",
+ "notes": ""
+ },
+ {
+ "id": "notice.undone.nothing",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Nothing was undone: it was changed again since. History shows who changed it.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "notice.undone.partly",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Undone, except where it was changed again since. History shows what was left.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "notice.refused",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "That value could not be saved, so nothing was written.",
+ "context": "History's Restore, refused.",
+ "notes": ""
+ },
+ {
+ "id": "notice.conflict",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Someone changed that field since this page was drawn, so nothing was written.",
+ "context": "History's Restore, stale.",
+ "notes": ""
+ },
+ {
+ "id": "notice.undo",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Undo",
+ "context": "Button.",
+ "notes": ""
+ },
+ {
+ "id": "notice.redo",
+ "section": "Notices after a scriptless save",
+ "label": "Notice",
+ "text": "Redo",
+ "context": "Button.",
+ "notes": ""
+ },
+ {
+ "id": "card.prev",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Previous",
+ "context": "Link at the pane's top (rel=prev).",
+ "notes": ""
+ },
+ {
+ "id": "card.next",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Next",
+ "context": "Link (rel=next).",
+ "notes": ""
+ },
+ {
+ "id": "card.jk",
+ "section": "The card",
+ "label": "Card text",
+ "text": "next and previous",
+ "context": "After the J and K keys, beside the links.",
+ "notes": ""
+ },
+ {
+ "id": "card.full",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Full page",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "card.close",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Close the card",
+ "context": "Accessible name of ✕.",
+ "notes": ""
+ },
+ {
+ "id": "card.back",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Back to the list",
+ "context": "Accessible name of the narrowed list's back arrow.",
+ "notes": ""
+ },
+ {
+ "id": "card.edited",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Edited by {name} {ago}",
+ "context": "'Edited by niamh 2 days ago'.",
+ "notes": ""
+ },
+ {
+ "id": "card.position",
+ "section": "The card",
+ "label": "Card text",
+ "text": "{n} of {total}",
+ "context": "Where the card sits in the list.",
+ "notes": ""
+ },
+ {
+ "id": "card.notinview",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Not in this view",
+ "context": "In place of '2 of 7' when the card is not in the list.",
+ "notes": ""
+ },
+ {
+ "id": "card.save",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Save changes",
+ "context": "The card form's button; hidden with script, where each field saves on its own.",
+ "notes": ""
+ },
+ {
+ "id": "card.visit",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Visit {address}",
+ "context": "Screen-reader name of the link beside a web address.",
+ "notes": ""
+ },
+ {
+ "id": "card.write",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Write to {address}",
+ "context": "Beside an email.",
+ "notes": ""
+ },
+ {
+ "id": "card.call",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Call {number}",
+ "context": "Beside a phone number.",
+ "notes": ""
+ },
+ {
+ "id": "card.calllog",
+ "section": "The card",
+ "label": "Card text",
+ "text": "Call log",
+ "context": "Section heading (was Call log before).",
+ "notes": ""
+ },
+ {
+ "id": "history.title",
+ "section": "History",
+ "label": "History text",
+ "text": "History of {title}",
+ "context": "Page heading.",
+ "notes": ""
+ },
+ {
+ "id": "history.back",
+ "section": "History",
+ "label": "History text",
+ "text": "Back to the card",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.intro",
+ "section": "History",
+ "label": "History text",
+ "text": "Each change to this {type}, newest first. For 90 days a change keeps the values it replaced, and any of them can be put back; after that it keeps who changed what, and when.",
+ "context": "Under the heading (Q11).",
+ "notes": ""
+ },
+ {
+ "id": "history.created",
+ "section": "History",
+ "label": "History text",
+ "text": "{name} created this {type}",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.call",
+ "section": "History",
+ "label": "History text",
+ "text": "{name} logged a call",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.undo",
+ "section": "History",
+ "label": "History text",
+ "text": "{name} undid an earlier change",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.redo",
+ "section": "History",
+ "label": "History text",
+ "text": "{name} redid a change",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.changed",
+ "section": "History",
+ "label": "History text",
+ "text": "{name} changed {fields}",
+ "context": "{fields} joined with ', '.",
+ "notes": ""
+ },
+ {
+ "id": "history.empty",
+ "section": "History",
+ "label": "History text",
+ "text": "empty",
+ "context": "A value that was blank.",
+ "notes": ""
+ },
+ {
+ "id": "history.restore",
+ "section": "History",
+ "label": "History text",
+ "text": "Restore this value",
+ "context": "Button per field inside the window.",
+ "notes": ""
+ },
+ {
+ "id": "history.none",
+ "section": "History",
+ "label": "History text",
+ "text": "No changes yet.",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.removed",
+ "section": "History",
+ "label": "History text",
+ "text": "A removed field",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "history.fichas",
+ "section": "History",
+ "label": "History text",
+ "text": "Fichas",
+ "context": "Who, for Fichas' own changes.",
+ "notes": ""
+ },
+ {
+ "id": "sheet.cancel",
+ "section": "Phone sheet",
+ "label": "Button",
+ "text": "Cancel",
+ "context": "The phone's edit sheet (§5.8).",
+ "notes": ""
+ },
+ {
+ "id": "sheet.save",
+ "section": "Phone sheet",
+ "label": "Button",
+ "text": "Save",
+ "context": "",
+ "notes": ""
+ },
+ {
+ "id": "date.today",
+ "section": "Dates in words",
+ "label": "Relative date",
+ "text": "today",
+ "context": "A date field within two weeks; past that, the reader's locale writes the date (§6.8).",
+ "notes": ""
+ },
+ {
+ "id": "date.tomorrow",
+ "section": "Dates in words",
+ "label": "Relative date",
+ "text": "tomorrow",
+ "context": "A date field within two weeks; past that, the reader's locale writes the date (§6.8).",
+ "notes": ""
+ },
+ {
+ "id": "date.yesterday",
+ "section": "Dates in words",
+ "label": "Relative date",
+ "text": "yesterday",
+ "context": "A date field within two weeks; past that, the reader's locale writes the date (§6.8).",
+ "notes": ""
+ },
+ {
+ "id": "date.in",
+ "section": "Dates in words",
+ "label": "Relative date",
+ "text": "in {n} days",
+ "context": "A date field within two weeks; past that, the reader's locale writes the date (§6.8).",
+ "notes": ""
+ },
+ {
+ "id": "date.ago",
+ "section": "Dates in words",
+ "label": "Relative date",
+ "text": "{n} days ago",
+ "context": "A date field within two weeks; past that, the reader's locale writes the date (§6.8).",
+ "notes": ""
+ }
+]
\ No newline at end of file
diff --git a/docs/superpowers/specs/2026-11-17-fichas-level-up.md b/docs/superpowers/specs/2026-11-17-fichas-level-up.md
index 14cb121..f145680 100644
--- a/docs/superpowers/specs/2026-11-17-fichas-level-up.md
+++ b/docs/superpowers/specs/2026-11-17-fichas-level-up.md
@@ -1097,6 +1097,9 @@ Choices made while building, where this spec was silent or the build chose diffe
17. **`Index.Sync` rebuilds on a `group` event** (no group is written before Phase 6, which will say which types a folder change touches) and when a field event's field is gone; `reloadType` reloads the type's cards as well as its labels, where §9 says metadata, because a field's rename or options change how every card of the type is drawn.
18. **With a card open beside the list, the bar's title is the card's,** as on its full page: the card is the open object.
19. **The conflict line says "You changed this … in another tab."** when the last change was the person's own, and never "a moment ago", which the event's time does not back.
+20. **A web address stored with `http://` keeps it.** A field draws an address without its scheme; posted back untouched it is the stored value, so the forms never rewrite `http://` to `https://` behind a person's back. An address a person types without a scheme gets `https://`, as before (Fable's Phase 1 review, round 2, accepted).
+21. **A `<time>` whose text is a date in the reader's locale carries that locale's `lang`** (WCAG 3.1.2); one whose text is the interface's English ("in 3 days") does not. Line endings are compared newline-blind in one place, `EditFields`, and the forms' handlers do not repeat it.
+22. **The new user-facing strings** are in `copy-review/level-up-phase-1/strings.json` for Paul's copy review; none is reviewed yet.
---
diff --git a/internal/fichas/card_handlers.go b/internal/fichas/card_handlers.go
index 0844aeb..a5cf3c9 100644
--- a/internal/fichas/card_handlers.go
+++ b/internal/fichas/card_handlers.go
@@ -124,7 +124,7 @@ func formEdit(r *http.Request, card CardView) (values, was, typed map[string]str
w, sent := r.PostForm["was."+key]
was[key] = f.Value
if sent {
- was[key] = lf(w[0])
+ was[key] = w[0] // compared newline-blind by EditFields
}
typed[key] = r.PostForm.Get(key)
v, problem := postedValue(r, f.Def, was[key])
diff --git a/internal/fichas/edit_handlers.go b/internal/fichas/edit_handlers.go
index e927fcd..b0ee996 100644
--- a/internal/fichas/edit_handlers.go
+++ b/internal/fichas/edit_handlers.go
@@ -47,7 +47,7 @@ func echoedLocale(r *http.Request, key string) string {
// postedValue is one field's posted value, read in the page's locale and
// made canonical; or a message saying what to fix.
func postedValue(r *http.Request, def FieldDef, was string) (string, string) {
- raw := lf(strings.TrimSpace(r.PostForm.Get(def.Key)))
+ raw := strings.TrimSpace(r.PostForm.Get(def.Key))
// A web address is drawn without its scheme; drawn back untouched it
// is the value the editor saw, not a change to https:// (§5.2).
if def.Kind == KindURL && was != "" && raw == displayURL(was) {
@@ -91,7 +91,9 @@ func (a *app) setFieldValue(w http.ResponseWriter, r *http.Request) {
notFound(w, r)
return
}
- was := lf(r.PostForm.Get("was." + key))
+ // Line endings are the store's one rule (EditFields compares
+ // newline-blind; normaliseValue writes LF), not repeated here.
+ was := r.PostForm.Get("was." + key)
value, problem := postedValue(r, f.Def, was)
if problem != "" {
a.refuseField(w, r, card, key, problem)
diff --git a/internal/fichas/render.go b/internal/fichas/render.go
index 9e71cbd..9634c81 100644
--- a/internal/fichas/render.go
+++ b/internal/fichas/render.go
@@ -53,6 +53,9 @@ func init() {
"dateAgo": dateAgo,
"stamp": stamp,
"longDate": longDate,
+ "dateLang": dateLang,
+ "agoLang": agoLang,
+ "sameText": sameText,
"stageTone": stageTone,
"isLong": isLong,
"lower": lower,
@@ -193,14 +196,11 @@ func longDate(L *ui.Localizer, v string) string {
// the future — a next action usually is. Anything that does not parse is
// returned unchanged rather than hidden.
func dateAgo(L *ui.Localizer, v string) string {
- d, err := time.ParseInLocation("2006-01-02", v, time.Local)
- if err != nil {
+ d, days, ok := daysFromToday(v)
+ if !ok {
return v
}
dates := datesOf(L)
- now := time.Now()
- today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
- days := int(d.Sub(today).Hours() / 24)
switch {
case days == 0:
return "today"
@@ -212,13 +212,43 @@ func dateAgo(L *ui.Localizer, v string) string {
return "in " + dates.Number(days) + " days"
case days < -1 && days > -14:
return dates.Number(-days) + " days ago"
- case d.Year() == now.Year():
+ case d.Year() == time.Now().Year():
return dates.Format("date", d)
default:
return dates.Format("dateYear", d)
}
}
+// daysFromToday reads a stored date and counts the days from today to
+// it, or reports it is no date.
+func daysFromToday(v string) (time.Time, int, bool) {
+ d, err := time.ParseInLocation("2006-01-02", v, time.Local)
+ if err != nil {
+ return time.Time{}, 0, false
+ }
+ now := time.Now()
+ today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+ return d, int(d.Sub(today).Hours() / 24), true
+}
+
+// dateLang is the lang of what dateAgo writes: the reader's locale when
+// it writes a date in that locale's words ("4. März"), nothing when it
+// writes the interface's English ("in 3 days"). WCAG 3.1.2.
+func dateLang(L *ui.Localizer, v string) string {
+ if _, days, ok := daysFromToday(v); ok && (days >= 14 || days <= -14) && L != nil {
+ return L.Identity()
+ }
+ return ""
+}
+
+// agoLang is ago's: the reader's locale once ago writes a date.
+func agoLang(L *ui.Localizer, when time.Time) string {
+ if time.Since(when) >= 14*24*time.Hour && L != nil {
+ return L.Identity()
+ }
+ return ""
+}
+
func relative(dates *locale.Locale, now, when time.Time) string {
d := now.Sub(when)
switch {
diff --git a/internal/fichas/templates/card_layout.html b/internal/fichas/templates/card_layout.html
index 1794277..0c8edad 100644
--- a/internal/fichas/templates/card_layout.html
+++ b/internal/fichas/templates/card_layout.html
@@ -23,7 +23,7 @@
<h2 fichas-card-title><span>{{.Title}}</span>{{with $face.Pill}}{{template "status-pill" (dict "Label" . "Tone" (stageTone .))}}{{end}}</h2>
{{range $face.Lines}}
{{if eq .Kind "call"}}<p fichas-card-quote>{{.Value}}</p>
- {{else if eq .Kind "date"}}<p fichas-meta>{{.Label}} <time datetime="{{.Date}}" title="{{longDate $.L .Date}}">{{dateAgo $.L .Date}}</time></p>
+ {{else if eq .Kind "date"}}<p fichas-meta>{{.Label}} <time datetime="{{.Date}}" title="{{longDate $.L .Date}}"{{with dateLang $.L .Date}} lang="{{.}}"{{end}}>{{dateAgo $.L .Date}}</time></p>
{{else if eq .Kind "longtext"}}<p fichas-meta fichas-clamp>{{.Value}}</p>
{{else if eq .Kind "url"}}<p fichas-meta>{{displayURL .Value}}</p>
{{else}}<p fichas-meta>{{.Value}}</p>{{end}}
diff --git a/internal/fichas/templates/history.html b/internal/fichas/templates/history.html
index f2f10db..e945d3f 100644
--- a/internal/fichas/templates/history.html
+++ b/internal/fichas/templates/history.html
@@ -16,7 +16,7 @@
{{else if .Undo}}undid an earlier change
{{else if .Redo}}redid a change
{{else}}changed {{range $i, $f := .Fields}}{{if $i}}, {{end}}{{$f.Label}}{{end}}{{end}}
- <time datetime="{{.When.Format "2006-01-02T15:04:05Z07:00"}}" title="{{stamp $.L .When}}">{{ago $.L .When}}</time>
+ <time datetime="{{.When.Format "2006-01-02T15:04:05Z07:00"}}" title="{{stamp $.L .When}}"{{with agoLang $.L .When}} lang="{{.}}"{{end}}>{{ago $.L .When}}</time>
</p>
{{if and .Held .Fields (ne .Kind "entry_added")}}
<dl fichas-history-values>
@@ -26,7 +26,7 @@
<span fichas-history-before>{{with showValue $L .Kind .Before}}{{.}}{{else}}<span fichas-empty-cell>empty</span>{{end}}</span>
<span aria-hidden="true"> → </span><span class="rst-sr-only"> to </span>
<span fichas-history-after>{{with showValue $L .Kind .After}}{{.}}{{else}}<span fichas-empty-cell>empty</span>{{end}}</span>
- {{$now := index $.Now .Key}}{{if and (ne $item.Kind "created") (ne $now .Before)}}
+ {{$now := index $.Now .Key}}{{if and (ne $item.Kind "created") (not (sameText $now .Before))}}
<form method="post" action="/cards/{{$c.Card.ID}}/fields/{{.Key}}" fichas-restore>
<input type="hidden" name="was.{{.Key}}" value="{{$now}}">
<input type="hidden" name="{{.Key}}" value="{{seed $L ($c.Field .Key).Def .Before}}">
diff --git a/internal/fichas/templates/index.html b/internal/fichas/templates/index.html
index 5785247..55e4e68 100644
--- a/internal/fichas/templates/index.html
+++ b/internal/fichas/templates/index.html
@@ -56,7 +56,7 @@
<h2 fichas-card-title><a href="{{$.List.OpenHref $c.Card.ID}}">{{$c.Title}}</a>{{with $face.Pill}}{{template "status-pill" (dict "Label" . "Tone" (stageTone .))}}{{end}}</h2>
{{range $face.Lines}}
{{if eq .Kind "call"}}<p fichas-card-quote>{{.Value}}</p>
- {{else if eq .Kind "date"}}<p fichas-meta>{{.Label}} <time datetime="{{.Date}}" title="{{longDate $.L .Date}}">{{dateAgo $.L .Date}}</time></p>
+ {{else if eq .Kind "date"}}<p fichas-meta>{{.Label}} <time datetime="{{.Date}}" title="{{longDate $.L .Date}}"{{with dateLang $.L .Date}} lang="{{.}}"{{end}}>{{dateAgo $.L .Date}}</time></p>
{{else if eq .Kind "longtext"}}<p fichas-meta fichas-clamp>{{.Value}}</p>
{{else if eq .Kind "url"}}<p fichas-meta>{{displayURL .Value}}</p>
{{else if eq .Kind "number"}}<p fichas-meta>{{.Label}} <span fichas-number>{{showNumber $.L .Value}}</span></p>
@@ -107,7 +107,7 @@
{{if $c.IsTitle $f.Def.Key}}<th scope="row" fichas-title-cell><a fichas-title-link href="{{$.List.OpenHref $c.Card.ID}}">{{$c.Title}}</a></th>
{{else}}<td data-field="{{$f.Def.Key}}" data-kind="{{$f.Def.Kind}}" data-label="{{$f.Label}}" data-was="{{$f.Value}}" data-seed="{{seed $.L $f.Def $f.Value}}"{{if eq $f.Def.Kind "enum"}} data-options="{{range $i, $o := $f.Options}}{{if $i}}{{"\n"}}{{end}}{{$o}}{{end}}"{{end}}><a fichas-cell-link href="/cards/{{$c.Card.ID}}/edit?field={{$f.Def.Key}}&amp;return_to={{$.Here}}#{{$f.Def.Key}}">{{template "fichas-cell-value" (dict "F" $f "L" $.L)}}<span class="rst-sr-only">, change {{$f.Label}}</span></a></td>{{end}}
{{end}}{{end}}
- {{if index $.Shown "_last_call"}}<td data-readonly>{{with $c.Latest}}<time datetime="{{.Entry.CreatedAt.Format "2006-01-02"}}" title="{{stamp $.L .Entry.CreatedAt}}">{{ago $.L .Entry.CreatedAt}}</time>{{else}}<span fichas-empty-cell>never</span>{{end}}</td>{{end}}
+ {{if index $.Shown "_last_call"}}<td data-readonly>{{with $c.Latest}}<time datetime="{{.Entry.CreatedAt.Format "2006-01-02"}}" title="{{stamp $.L .Entry.CreatedAt}}"{{with agoLang $.L .Entry.CreatedAt}} lang="{{.}}"{{end}}>{{ago $.L .Entry.CreatedAt}}</time>{{else}}<span fichas-empty-cell>never</span>{{end}}</td>{{end}}
</tr>
{{end}}
</tbody>
@@ -129,7 +129,7 @@
{{range $c := .Cards}}{{$face := $c.Face $.Face}}
<li><a href="{{$.List.OpenHref $c.Card.ID}}"{{if eq $c.Card.ID $open.Card.ID}} aria-current="true"{{end}}>
<strong>{{$c.Title}}</strong>
- <span fichas-narrow-face>{{with $face.Pill}}{{template "status-pill" (dict "Label" . "Tone" (stageTone .))}}{{end}}{{range $i, $l := $face.Lines}}{{if and (eq $i 0) (ne $l.Kind "call")}}<span fichas-meta>{{if eq $l.Kind "date"}}{{dateAgo $.L $l.Date}}{{else if eq $l.Kind "number"}}{{showNumber $.L $l.Value}}{{else}}{{$l.Value}}{{end}}</span>{{end}}{{end}}</span>
+ <span fichas-narrow-face>{{with $face.Pill}}{{template "status-pill" (dict "Label" . "Tone" (stageTone .))}}{{end}}{{range $i, $l := $face.Lines}}{{if and (eq $i 0) (ne $l.Kind "call")}}<span fichas-meta>{{if eq $l.Kind "date"}}<time datetime="{{$l.Date}}"{{with dateLang $.L $l.Date}} lang="{{.}}"{{end}}>{{dateAgo $.L $l.Date}}</time>{{else if eq $l.Kind "number"}}{{showNumber $.L $l.Value}}{{else}}{{$l.Value}}{{end}}</span>{{end}}{{end}}</span>
</a></li>
{{end}}
</ol>
diff --git a/internal/fichas/templates/partials.html b/internal/fichas/templates/partials.html
index b5d6e48..a832666 100644
--- a/internal/fichas/templates/partials.html
+++ b/internal/fichas/templates/partials.html
@@ -99,7 +99,7 @@
{{define "fichas-cell-value"}}{{$f := .F}}{{$v := $f.Value}}
{{- if not $v}}<span fichas-empty-cell>—</span>
{{- else if eq $f.Def.Kind "enum"}}{{template "status-pill" (dict "Label" $v "Tone" (stageTone $v))}}
-{{- else if eq $f.Def.Kind "date"}}<time datetime="{{$v}}" title="{{longDate .L $v}}">{{dateAgo .L $v}}</time>
+{{- else if eq $f.Def.Kind "date"}}<time datetime="{{$v}}" title="{{longDate .L $v}}"{{with dateLang .L $v}} lang="{{.}}"{{end}}>{{dateAgo .L $v}}</time>
{{- else if eq $f.Def.Kind "number"}}<span fichas-number>{{showNumber .L $v}}</span>
{{- else if eq $f.Def.Kind "url"}}{{displayURL $v}}
{{- else}}{{$v}}{{end}}{{end}}
@@ -168,7 +168,7 @@
{{end}}{{end}}
<p fichas-card-meta>
<span>{{$c.TypeLabel}}</span>
- {{with .P.EditedBy}}<span>Edited by {{.}} <time datetime="{{$.P.EditedAt.Format "2006-01-02T15:04:05Z07:00"}}" title="{{stamp $.L $.P.EditedAt}}">{{ago $.L $.P.EditedAt}}</time></span>{{end}}
+ {{with .P.EditedBy}}<span>Edited by {{.}} <time datetime="{{$.P.EditedAt.Format "2006-01-02T15:04:05Z07:00"}}" title="{{stamp $.L $.P.EditedAt}}"{{with agoLang $.L $.P.EditedAt}} lang="{{.}}"{{end}}>{{ago $.L $.P.EditedAt}}</time></span>{{end}}
{{if .Pane}}{{with .P.Pos}}<span>{{number $L .At}} of {{number $L .Total}}</span>{{else}}<span fichas-not-in-view>{{icon "info"}}Not in this view</span>{{end}}{{end}}
</p>
<div fichas-card-fields>
@@ -189,7 +189,7 @@
{{if $c.Entries}}
<ol fichas-timeline>
{{range $c.Entries}}
- <li><time datetime="{{.Entry.CreatedAt.Format "2006-01-02"}}" title="{{stamp $.L .Entry.CreatedAt}}">{{ago $.L .Entry.CreatedAt}}</time><p>{{.Body}}</p></li>
+ <li><time datetime="{{.Entry.CreatedAt.Format "2006-01-02"}}" title="{{stamp $.L .Entry.CreatedAt}}"{{with agoLang $.L .Entry.CreatedAt}} lang="{{.}}"{{end}}>{{ago $.L .Entry.CreatedAt}}</time><p>{{.Body}}</p></li>
{{end}}
</ol>
{{else}}
diff --git a/internal/fichastest/edit_routes_test.go b/internal/fichastest/edit_routes_test.go
index 4b6a7a5..ba375a4 100644
--- a/internal/fichastest/edit_routes_test.go
+++ b/internal/fichastest/edit_routes_test.go
@@ -429,7 +429,9 @@ func TestTheReadersLocaleComesFromTheBrowserOnly(t *testing.T) {
}
// LU17, dates: a date and a moment are written as the reader's locale
-// writes them, by Mapa's patterns.
+// writes them, by Mapa's patterns, marked with its lang.
+//
+// Mutation, 2026-11-17: dropping dateLang's lang from the cell failed it.
func TestDatesAreWrittenInTheReadersLocale(t *testing.T) {
r := newEditRig(t)
id := r.card(t, map[string]string{fichas.FieldName: "Cnoc", fichas.FieldNextAction: "2030-03-04"})
@@ -437,7 +439,9 @@ func TestDatesAreWrittenInTheReadersLocale(t *testing.T) {
"en-IE": "4 March 2030", "en-US": "March 4, 2030", "de": "4. März 2030", "fr": "4 mars 2030", "es": "4 de marzo de 2030",
} {
list := getAs(t, r.h, "/", lang).Body.String()
- if !strings.Contains(list, `title="`+want+`">`+want+`</time>`) {
+ // The date is in the reader's locale's words, and says so (WCAG
+ // 3.1.2): lang is the locale's own code.
+ if !strings.Contains(list, `title="`+want+`" lang="`+lang+`">`+want+`</time>`) {
t.Errorf("%s: the table does not write the next action as %q", lang, want)
}
hist := getAs(t, r.h, cardPath(id)+"/history", lang).Body.String()
@@ -511,3 +515,27 @@ func TestAPartialUndoSaysWhatItLeft(t *testing.T) {
t.Fatalf("a partial Undo does not say what it left (%s)", undo.Header().Get("Location"))
}
}
+
+// A form posts its textareas and hidden fields with CRLF; Notes stored
+// with LF are the same text (Fable, Phase 1 review, H1). Through the
+// scriptless form's route, end to end.
+//
+// Mutation, 2026-11-17: comparing was byte for byte in EditFields (the
+// one place the rule lives) failed it with a 409.
+func TestAFormsCRLFIsTheSameText(t *testing.T) {
+ r := newEditRig(t)
+ id := r.card(t, map[string]string{fichas.FieldName: "Cnoc", fichas.FieldNotes: "line one\nline two"})
+ rec := post(t, r.h, cardPath(id), url.Values{
+ fichas.FieldNotes: {"line one\r\nline two\r\nline three"}, "was." + fichas.FieldNotes: {"line one\r\nline two"},
+ })
+ if rec.Code != http.StatusSeeOther || r.value(t, id, fichas.FieldNotes) != "line one\nline two\nline three" {
+ t.Fatalf("a CRLF form over LF notes: %d, notes %q", rec.Code, r.value(t, id, fichas.FieldNotes))
+ }
+ // An untouched CRLF textarea is no change at all.
+ again := post(t, r.h, cardPath(id), url.Values{
+ fichas.FieldNotes: {"line one\r\nline two\r\nline three"}, "was." + fichas.FieldNotes: {"line one\r\nline two\r\nline three"},
+ })
+ if loc := again.Header().Get("Location"); strings.Contains(loc, "saved=") {
+ t.Fatalf("an untouched CRLF textarea was saved as a change (%s)", loc)
+ }
+}
diff --git a/internal/fichastest/formats_markup_test.go b/internal/fichastest/formats_markup_test.go
index c2eddb3..e65a6b5 100644
--- a/internal/fichastest/formats_markup_test.go
+++ b/internal/fichastest/formats_markup_test.go
@@ -14,14 +14,22 @@ import (
//
// Mutation, 2026-11-17: {{number .Result.Total}} in index.html failed it.
func TestEveryLocaleCallNamesTheReadersLocalizer(t *testing.T) {
- call := regexp.MustCompile(`[{(]-?\s*(number|money|showNumber|showValue|seed|count|ago|dateAgo|stamp|longDate|editField)\s+(\S+)`)
+ // Each {{action}}, then each call of a locale function inside it,
+ // wherever it stands: first, after with, if, else if or range, in
+ // brackets, or after a pipe.
+ action := regexp.MustCompile(`\{\{-?([^}]*)-?\}\}`)
+ call := regexp.MustCompile(`(?:^|[\s(|])(number|money|showNumber|showValue|seed|count|ago|dateAgo|stamp|longDate|editField|dateLang|agoLang)\s+(\S+)`)
paths, _ := filepath.Glob(filepath.Join("..", "fichas", "templates", "*.html"))
for _, path := range paths {
body := read(t, path)
if strings.Contains(body, "commas") {
t.Errorf("%s still calls commas", filepath.Base(path))
}
- for _, m := range call.FindAllStringSubmatch(body, -1) {
+ var calls [][]string
+ for _, a := range action.FindAllStringSubmatch(body, -1) {
+ calls = append(calls, call.FindAllStringSubmatch(a[1], -1)...)
+ }
+ for _, m := range calls {
fn, arg := m[1], strings.TrimRight(m[2], ")}")
if fn == "editField" {
continue // its localizer is its third argument, checked below