-
Notifications
You must be signed in to change notification settings - Fork 324
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
Allow users to override hardcoded strings in our component JavaScript (internationalisation) #1708
Comments
At HMRC we only have one component which requires this, we've implemented it with The component which does this is a pure JS component which is activated by a custom meta tag. https://github.com/hmrc/hmrc-frontend/blob/master/src/components/timeout-dialog/template.njk I'd suggest that the user of a component shouldn't need to know which content is produced by JS and which isn't. Providing them all via the component parameters is my attempt to achieve that. |
At DVLA, we require frontend component localisation for supporting the welsh language. This is, in most cases, done within our application but on components such as the text area character count, this is done within the GOVUK frontend via Javascript. This means we cannot localise the text on these components. This issue was present in 2018 when a PR was opened (and subsequently declined) in favour of a more common approach: #1038 This consistent approach across all components will allow localisation and allow us to offer our customers fully internationalised pages, rather than a mix of Welsh and English which we currently have due to this component. Note, we are fully aware that we can bring the code in-house and modify it to our needs, but this would mean more overhead to keep up to date with the centralised repo. This is something we want to try and avoid if at all possible. |
Re: prioritsation of config passed by data attributes and config passed by JavaScript, we've decided that data attributes should always take precedence over config passed by JavaScript. |
I'm calling this done – the only unticked items are only tangentially unrelated. |
What
Allow strings in our component JavaScript to be customised/changed, to allow for text in other languages, e.g: Welsh.
Why
Some service teams have a requirement to provide their services in Welsh as well as English (and other teams support a wider range of language translations too). At the moment, service teams are stuck with some elements of the page in English unless they manually copy our JavaScript into their application, which isn't ideal.
Related issues:
This work is also closely related to how we allow users to set and configure JavaScript options. We should keep in mind that it may be simpler to develop a solution for internationalisation that also works for setting all configurable JavaScript options.
Who needs to know about this
Developers; Tech Writer
Done when
Prep & Research
Missing Nunjucks translations
Translating hardcoded strings in JS
Documentation
Stretch Goals
The text was updated successfully, but these errors were encountered: