Skip to content

Commit 975c5c4

Browse files
committed
bug fixes
1 parent 3c6dc3c commit 975c5c4

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

i18n.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ define(["./i18n/common", "./i18n/build", "module"], function (common, build, mod
120120
}
121121
};
122122

123-
/* jshint -W074 */
124123
return {
125124
/* jshint -W074 */
126125
load: function (name, req, onLoad, config) {
@@ -134,7 +133,7 @@ define(["./i18n/common", "./i18n/build", "module"], function (common, build, mod
134133
mixin(moduleConfig, typeof module.config === "function" ? module.config() || {} : {});
135134

136135
if (config.isBuild) {
137-
localesList = config.localesList;
136+
localesList = moduleConfig.localesList;
138137
onLoad();
139138
return;
140139
}
@@ -191,7 +190,7 @@ define(["./i18n/common", "./i18n/build", "module"], function (common, build, mod
191190
bundle._pseudoRoot = {};
192191
bundle._flattened = true;
193192
}
194-
write.asModule(moduleName, "define(" + JSON.stringify(bundle) + ")");
193+
write.asModule(pluginName + "!" + moduleName, "define(" + JSON.stringify(bundle) + ")");
195194
} else {
196195
build.addBundleToNlsLayer(name);
197196
}
@@ -210,8 +209,5 @@ define(["./i18n/common", "./i18n/build", "module"], function (common, build, mod
210209
}
211210
build.reset();
212211
}
213-
214-
215212
};
216-
/* jshint +W074 */
217213
});

i18n/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ define(["./common", "require"], function (common, requirejs) {
132132
var parts = path.split("/"),
133133
tmp = [];
134134

135-
while (!fs.existsSync(parts.join("/"))) {
135+
while (parts.length && !fs.existsSync(parts.join("/"))) {
136136
tmp.push(parts.pop());
137137
}
138138
while (tmp.length) {

i18n/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(["../maybe!./parentLocale"], function (parentLocale) {
1+
define(["./parentLocale"], function (parentLocale) {
22

33
// regexp for reconstructing the master bundle name from parts of the regexp match
44
// "foo/bar/baz/nls/en-ca/foo".match(nlsRegExp) gives:
@@ -8,7 +8,7 @@ define(["../maybe!./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 || {};
11+
parentLocale = parentLocale;
1212

1313
return {
1414
eachProp: function (obj, func) {

0 commit comments

Comments
 (0)