Skip to content

Commit 1969bcf

Browse files
committed
Moving localization file to its proper place - before other resources
1 parent e57eae7 commit 1969bcf

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

build/updateResources.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function (options) {
3434
};
3535

3636
var processStream = function (file, encoding, next) {
37-
var contents, stream, $;
37+
var contents, stream, $, jsStart;
3838

3939
contents = file.contents.toString(encoding);
4040
stream = this;
@@ -43,7 +43,12 @@ module.exports = function (options) {
4343
$ = file.cheerio = file.cheerio || cheerio.load(contents, { decodeEntities: false });
4444

4545
if (file.lang == "ja") {
46-
$("head").append("<script src=\"%%ignite-ui%%/js/i18n/infragistics-ja.js\"></script>");
46+
// find the first script file /js/infragistics.(core|loader)
47+
jsStart = $("script[src*='%%ignite-ui%%/js/infragistics.']");
48+
if (!jsStart.length) {
49+
throw new Error("Couldn't find core or loader script.");
50+
}
51+
jsStart.eq(0).before("<script src=\"%%ignite-ui%%/js/i18n/infragistics-ja.js\"></script>");
4752
$("head").append("<script src=\"%%ignite-ui%%/js/modules/i18n/regional/infragistics.ui.regional-ja.js\"></script>");
4853
}
4954

0 commit comments

Comments
 (0)