You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow english text provided by javascript to be customised or changed (for translation).
Motivation
During an accessibility audit we had the following issue raised.
Issue: Table sort by copy for screen readers not translated to Welsh (AA)
WCAG 2.1 violation: WCAG 2.1 violation: 3.1.2: Language of Parts
Page: All pages using the table sort by functionality
Description: When switching the language of the page to Welsh, the table sort by copy read by screen readers remains partly in English, e.g. "Sort by Cyfeirnod cleient (descending)"
The text is provided by the JS from MOJ frontend. Currently there is no functionality to support other languages.
Describe alternatives you've considered
I have made this change manually for our service in our copy of minified MOJ frontend. This is the only workaround available. hmrc/agent-permissions-frontend#194
Ideally, users of MOJ frontend would have the capability to provide customised context for any strings used in messages.
Additional context
In different projects alternative languages are configured in different ways. HMRC Digital's platform is built with Scala/Play framework so typically content is defined in messages and messages.cy files.
In the latest version of the pattern library you can configure translations for Sortable table when initialised with JavaScript:
newMOJFrontend.SortableTable({table: $table,statusMessage: 'Trefnu yn ôl %heading% (%direction%)',ascendingText: 'esgynnol',descendingText: 'disgynnol',});
However, this isn't documented, isn't very flexible, and isn't consistent with other components
Components which still have English hard-coded:
Add another (Remove button)
Multi select ("Select all" label)
Password reveal ("Show/Hide password" button)
Components where you can override the translation, but it's not consistent:
Summary
Allow english text provided by javascript to be customised or changed (for translation).
Motivation
During an accessibility audit we had the following issue raised.
The text is provided by the JS from MOJ frontend. Currently there is no functionality to support other languages.
Describe alternatives you've considered
I have made this change manually for our service in our copy of minified MOJ frontend. This is the only workaround available.
hmrc/agent-permissions-frontend#194
Ideally, users of MOJ frontend would have the capability to provide customised context for any strings used in messages.
Additional context
In different projects alternative languages are configured in different ways. HMRC Digital's platform is built with Scala/Play framework so typically content is defined in
messages
andmessages.cy
files.But govuk-frontend has been working on a similar issue with their JS alphagov/govuk-frontend#1708
The text was updated successfully, but these errors were encountered: