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

Expand internationalisation MVP to add string interpolation feature

Open vanitabarrett opened this issue 2 years ago • 0 comments

What

In some components, we'll need to be able to insert a dynamic string or value inside a translated string, e.g: "You have [x] characters remaining". We need to give users a way to pass us a string and indicate where the value should go, e.g: You have %{count} character remaining

Expand the existing internationalisation logic to handle this kind of string interpolation.

Why

We cannot hardcode where in the string that value will sit, because it will be different for different languages.

Who needs to work on this

Developers

Who needs to review this

Developers

Depends on

https://github.com/alphagov/govuk-frontend/issues/2699

Done when

  • [ ] Internationalisation logic has been expanded to handle string interpolation
  • [ ] Unit tests added for new string interpolation logic

vanitabarrett avatar Jul 15 '22 08:07 vanitabarrett