govuk-frontend icon indicating copy to clipboard operation
govuk-frontend copied to clipboard

Add ability to translate hardcoded strings in accordion component JavaScript

Open vanitabarrett opened this issue 2 years ago • 0 comments

What

Implement an MVP internationalisation solution which allows hardcoded strings in component JS to be translated. As an MVP, this should involve being able to translate "simple strings". Pluralisation, string interpolation and number formatting will be covered in separate PRs.

Why

So we can begin to allow hardcoded strings in our accordion component JS to be translated. So we have a solution for translating hardcoded strings in future component JS.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • [ ] MVP internationalisation logic implemented and tested with unit tests
  • [ ] MVP internationalisation logic used by the accordion component, allowing all hardcoded strings to be translated
  • [ ] The accordion component still works if no translations are passed, e.g: falling back to defaults
  • [ ] The accordion component has tests which cover the new ability to translate
  • [ ] There are examples in the review app of the accordion component being translated
  • [ ] Added to or created a new full page example for translation of component JavaScript

vanitabarrett avatar Jul 15 '22 08:07 vanitabarrett