-
Notifications
You must be signed in to change notification settings - Fork 334
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 support for localisation via data-* attributes to Accordion component #2818
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! A coupla incredibly pedantic requests, but non-blocking.
My only wish is that we could be writing shiny new ES6+ code straight away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few very minor things but generally this is looking ace. Great work on the tests!
Have translated all strings that are currently possible to translate (should be everything apart from strings in hardcoded JS)
This function and the modified Element.prototype.dataset polyfill are taken from an earlier spike (govuk-frontend PR #2810) Add new helper function to extract config keys by namespace This is used to pull out the i18n-related configuration keys, so that they can be passed into the I18n function. Add data attribute localisation support to Accordion Write unit tests for mergeConfigs and extractConfigByNamespace Amend extractConfigByNamespace to pass unit tests Add Nunjucks parameter documentation Add integration tests for localisation of the accordion Change test -> it Add whitespace control to Yaml values Tweaking whitespace Add data attribute template tests
b20cef1
to
6ce08cc
Compare
Raising early as a draft PR for visibility and those sweet, sweet automated deployments. Will resolve #2699 on completion.
Element.prototype.dataset
polyfill from the config spike ([SPIKE][DO NOT MERGE] Create IE-compatible configuration merging function #2810).extractConfigByNamespace
, which non-destructively filters a flattened configuration object by a given namespace (e.g. retrieving all key-value pairs where the key starts with 'i18n.')