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 internationalisation logic to lookup translation from key #2801

Closed
4 tasks
Tracked by #1708
vanitabarrett opened this issue Aug 22, 2022 · 0 comments · Fixed by #2814
Closed
4 tasks
Tracked by #1708

Add internationalisation logic to lookup translation from key #2801

vanitabarrett opened this issue Aug 22, 2022 · 0 comments · Fixed by #2814
Assignees
Milestone

Comments

@vanitabarrett
Copy link
Contributor

What

Write the JavaScript logic needed for the most minimal internationalisation use case, i.e: replacing a default English string with a new string in a different language. The logic will need to be able to:

  • take a translations object
  • take a translation ‘key’ and look up the relevant string in the translations object

This should not cover more complex translations, e.g: pluralisation or string interpolation.

Why

So we can begin to allow hardcoded strings in our 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

  • Internationalisation logic written that takes a JavaScript object of translations
  • Ability to lookup a key within that translations object, and return a string
  • Nicely handles instances where the key cannot be found in the translations object
  • Unit tests written for the above
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