-
Notifications
You must be signed in to change notification settings - Fork 783
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add runtime localization support (#1036)
This patch adds support for runtime localization. A user may now provide a `locale` object (in the same shape as the locales in `/locale/*.json`) to `axe.configure()`. For example: ```js axe.configure({ locale: { rules: { 'some-rule': { help: 'the help message', description: 'the description' } }, checks: { [...] } } }) ``` These locale strings are run thru `doT`, enabling template support. For example: ```js axe.configure({ locale: { rules: { foo: { help: 'some help', description: 'foo: {{~it.data:value}} {{=value}}{{~}}.' } }, checks: { bar: { pass: 'the pass message', fail: 'something useful: {{~it.data:value}} {{=value}}{{~}}.' } } } }) ``` Upon calling `axe.reset()`, any custom locale will be reset to the "default" axe-core shipped with.
- Loading branch information
1 parent
5d6c1fa
commit 7d4b70f
Showing
8 changed files
with
637 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.