axe-core 4.12.0 → 4.12.1-canary.00519cc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -6
- package/axe.d.ts +4 -2
- package/axe.js +648 -423
- package/axe.min.js +2 -2
- package/locales/README.md +2 -2
- package/package.json +33 -41
- package/sri-history.json +4 -0
package/README.md
CHANGED
|
@@ -95,17 +95,13 @@ The [axe-core API](doc/API.md) package consists of:
|
|
|
95
95
|
|
|
96
96
|
Axe can be built using your local language. To do so, a localization file must be added to the `./locales` directory. This file must be named in the following manner: `<langcode>.json`. To build axe using this locale, instead of the default, run axe with the `--lang` flag, like so:
|
|
97
97
|
|
|
98
|
-
`grunt build --lang=nl`
|
|
99
|
-
|
|
100
|
-
or equivalently:
|
|
101
|
-
|
|
102
98
|
`npm run build -- --lang=nl`
|
|
103
99
|
|
|
104
100
|
This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
|
|
105
101
|
|
|
106
|
-
To create a new translation for axe, start by running `
|
|
102
|
+
To create a new translation for axe, start by running `npm run translate -- --lang=<langcode>`. This will create a json file in the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).
|
|
107
103
|
|
|
108
|
-
To update an existing translation file, re-run `
|
|
104
|
+
To update an existing translation file, re-run `npm run translate -- --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
|
|
109
105
|
|
|
110
106
|
Additionally, locale can be applied at runtime by passing a `locale` object to `axe.configure()`. The locale object must be of the same shape as existing locales in the `./locales` directory. For example:
|
|
111
107
|
|
package/axe.d.ts
CHANGED
|
@@ -352,7 +352,7 @@ declare namespace axe {
|
|
|
352
352
|
helpUrl: string;
|
|
353
353
|
tags: string[];
|
|
354
354
|
actIds?: string[];
|
|
355
|
-
enabled
|
|
355
|
+
enabled?: boolean;
|
|
356
356
|
}
|
|
357
357
|
interface SerialDqElement {
|
|
358
358
|
source: string;
|
|
@@ -623,7 +623,9 @@ declare namespace axe {
|
|
|
623
623
|
* @param {Array} tags Optional array of tags
|
|
624
624
|
* @return {Array} Array of rules
|
|
625
625
|
*/
|
|
626
|
-
function getRules(
|
|
626
|
+
function getRules(
|
|
627
|
+
tags?: string[]
|
|
628
|
+
): (Omit<RuleMetadata, 'enabled'> & { enabled: boolean })[];
|
|
627
629
|
|
|
628
630
|
/**
|
|
629
631
|
* Restores the default axe configuration
|