Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to pass translation strings to accordion component via data-attributes #2699

Closed
7 tasks done
Tracked by #1708
vanitabarrett opened this issue Jul 15, 2022 · 0 comments · Fixed by #2818
Closed
7 tasks done
Tracked by #1708

Comments

@vanitabarrett
Copy link
Contributor

vanitabarrett commented Jul 15, 2022

What

Adds ability to pass translation strings into the accordion component, using the Nunjucks macro.
Needs to work with the i18n logic added in #2801. There will need to be some kind of logic to look up the data translation attributes set on a component and return them as an object

Why

So users can translate the hardcoded strings in our accordion JS component
Passing translations via the Nunjucks macro enables them to do this without having to understand where different strings are (e.g: Nunjucks vs JavaScript) as it’s the same interface for both.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • The accordion component has new Nunjucks macro options for passing in translation strings (following the format decided on in Decide JavaScript and Nunjucks API for passing translation strings #2780)
  • Implemented JS code to lookup translations set using data attributes
  • Translations provided via data attributes are in a format that the internationalisation logic understands, i.e: a JS object
  • The accordion component JS uses the internationalisation logic to swap out hardcoded strings
  • The accordion component still works if no/only some translations are passed (falls back to defaults)
  • The accordion component has tests which cover the new ability to translate
  • Added to or created a full page example which shows full translation of the accordion component
@vanitabarrett vanitabarrett added this to Backlog 🗄 in Design System Sprint Board via automation Jul 15, 2022
@vanitabarrett vanitabarrett changed the title Add ability to translate hardcoded strings in accordion component JavaScript Add ability to pass translation strings to accordion component JS via JavaScript Aug 17, 2022
@vanitabarrett vanitabarrett changed the title Add ability to pass translation strings to accordion component JS via JavaScript Add ability to pass translation strings to accordion component JS Aug 17, 2022
@vanitabarrett vanitabarrett changed the title Add ability to pass translation strings to accordion component JS Add ability to pass translation strings to accordion component via data-attributes Aug 22, 2022
@kellylee-gds kellylee-gds moved this from Backlog 🗄 to Sprint Backlog 🏃🏼‍♀️ in Design System Sprint Board Aug 24, 2022
@querkmachine querkmachine self-assigned this Aug 30, 2022
@querkmachine querkmachine moved this from Sprint Backlog 🏃🏼‍♀️ to In progress 📝 in Design System Sprint Board Aug 30, 2022
@querkmachine querkmachine moved this from In progress 📝 to Needs review 🔍 in Design System Sprint Board Aug 31, 2022
@querkmachine querkmachine moved this from Needs review 🔍 to Ready to release 🚀 in Design System Sprint Board Sep 1, 2022
@36degrees 36degrees added this to the [NEXT] milestone Sep 12, 2022
@36degrees 36degrees moved this from Ready to release 🚀 to Done 🏁 in Design System Sprint Board Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants