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
Add ability for users to pass a translation object in via JavaScript (at the point of initialisation). This is an alternative method to passing translation strings via the Nunjucks macros (data-attributes).
Example:
new Accordion($element, {
"i18n.showAllSections": "Show everything"
}).init()
Why
Some users may prefer to pass translation strings via JavaScript, or it may be better suited to their service.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
It’s possible to provide translations to the accordion component via JavaScript
Expanded logic which looks up translations passed via data attributes, to lookup translations provided by JavaScript
Data attribute translations take priority over JS translations, if both provided
The accordion component still works if no/only some translations are passed (falls back to defaults)
The accordion component has tests which cover the ability to translate via JavaScript
The text was updated successfully, but these errors were encountered:
What
Add ability for users to pass a translation object in via JavaScript (at the point of initialisation). This is an alternative method to passing translation strings via the Nunjucks macros (data-attributes).
Example:
Why
Some users may prefer to pass translation strings via JavaScript, or it may be better suited to their service.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
The text was updated successfully, but these errors were encountered: