File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments