Skip to content

Commit a2f0247

Browse files
committed
fix(build): add lang query parameter to helpUrl when builing with a locale (#1909)
* fix(build); add lang query parameter to helpUrl when builing with a locale * add test * fix test
1 parent e6875ee commit a2f0247

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

build/configure.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ function buildRules(grunt, options, commons, callback) {
276276
auto: replaceFunctions(
277277
JSON.stringify(
278278
{
279+
lang: options.locale || 'en',
279280
data: metadata,
280281
rules: rules,
281282
checks: checks,

lib/core/base/audit.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ Audit.prototype._init = function() {
308308

309309
axe.commons = commons = audit.commons;
310310

311+
this.lang = audit.lang || 'en';
311312
this.reporter = audit.reporter;
312313
this.commands = {};
313314
this.rules = [];

test/core/public/load.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ describe('axe._load', function() {
4949
assert.equal(axe.commons, 'foo');
5050
});
5151

52+
it('should load with a lang', function() {
53+
axe._load({
54+
lang: 'ja'
55+
});
56+
assert.equal(axe._audit.lang, 'ja');
57+
});
58+
5259
describe('respondable subscriber', function() {
5360
it('should add a respondable subscriber', function() {
5461
var mockAudit = {

0 commit comments

Comments
 (0)