In the Table component, there is a visible "caption" (that actually exists outside the <table> element and is hidden from assistive technology), and a visually-hidden <caption> element that contains the caption text. When a table is sortable, a string is appended to the visually-hidden caption to explain to users of assistive technology that sortable columns have a button (that sorts the column when clicked)
@Aaharoni-WMF, who recently helped us when we introduced Codex messages into MediaWiki core, noted that the syntax of this message is not correct nor ideal. In English, a comma separating the caption from the appended clause is not grammatically correct, and a period or parentheses would be more ideal.
We originally took this syntax from the WAI's ARIA Authoring Practices Guide (APG). Amir presented this to them and they agreed that the syntax should be changed - see the GitHub issue. They fixed the guide, and the new version is published at https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/. The comma is replaced with parentheses.
Acceptance criteria
- Update the syntax in the default value for the cdx-table-sort-caption message in the Table component (the second argument of the useI18n() call) to ${ caption } (column headers with buttons are sortable).
const translatedSortCaption = useI18n( 'cdx-table-sort-caption', ( caption ) => `${ caption }, column headers with buttons are sortable.`, [ toRef( props, 'caption' ) ] );
- Update the English version of the cdx-table-sort-caption message in MediaWiki core (in languages/i18n/codex) to $1 (column headers with buttons are sortable).