Skip to content

Commit 46426fc

Browse files
committed
various bug fixes
1 parent d153f70 commit 46426fc

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed

Gruntfile.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ module.exports = function (grunt) {
4141
},
4242

4343
intern: {
44+
remote: {
45+
options: {
46+
runType: "runner",
47+
config: "tests/intern",
48+
reporters: ["console"]
49+
}
50+
},
4451
sauce: {
4552
options: {
4653
runType: 'runner', // defaults to 'client'

i18n.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ define(["./i18n/common", "./i18n/build", "module"], function (common, build, mod
125125
return {
126126
/* jshint maxcomplexity:15 */
127127
load: function (name, req, onLoad, config) {
128+
if (!name) {
129+
onLoad();
130+
return;
131+
}
132+
128133
config = config || {};
129134

130135
var moduleConfig = {},

i18n/build.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ define(["./common", "require"], function (common, requirejs) {
1616
return layerMid;
1717
},
1818

19+
getLayerPath = function (data, loc) {
20+
var match = data.path.match(/^(.*\/)?(.*)\.js$/);
21+
return (match[1] || "") + "nls/" + match[2] + "_" + loc + ".js";
22+
},
23+
1924
getAllAvailableLocales = function () {
2025
localesList = [];
2126
bundlesList.forEach(function (name) {
@@ -124,7 +129,7 @@ define(["./common", "require"], function (common, requirejs) {
124129
writeLayers: function (layersContent, data, writePluginFile) {
125130
eachProp(layersContent, function (loc, content) {
126131
content += "define('" + getLayerMid(data) + "_" + loc + "', true);";
127-
writePluginFile(getLayerMid(data) + "_" + loc + ".js", content);
132+
writePluginFile(getLayerPath(data, loc), content);
128133
});
129134
},
130135

i18n/common.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ define(["./parentLocale"], function (parentLocale) {
88
// so, if match[3] is blank, it means this is the top bundle definition.
99
var nlsRegExp = /(^.*(?:^|\/)nls\/)([^\/]*)\/?([^\/]*)$/;
1010

11-
parentLocale = parentLocale;
12-
1311
return {
1412
eachProp: function (obj, func) {
1513
var prop;
@@ -24,7 +22,9 @@ define(["./parentLocale"], function (parentLocale) {
2422
if (!locale) {
2523
locale = typeof navigator === "undefined" ? "root" :
2624
(navigator.language ||
27-
navigator.userLanguage || "root");
25+
// IE <= 10
26+
navigator.userLanguage ||
27+
"root");
2828
}
2929
// just to be extra-sure
3030
return locale.toLowerCase();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"grunt-contrib-jshint": "~0.6.0",
88
"grunt-jsbeautifier": "~0.2.2",
99
"requirejs": "~2.1.10",
10-
"intern": "~1.3.2",
10+
"intern": "~1.6.2",
1111
"grunt-lineending": "^0.2.2"
1212
},
1313
"licenses": [{

0 commit comments

Comments
 (0)