1
1
define ( [ "./common" ] , function ( common ) {
2
- var bundles = { } ,
2
+ var bundlesList = [ ] ,
3
3
localesList ,
4
4
layerMid ,
5
5
@@ -23,7 +23,7 @@ define(["./common"], function (common) {
23
23
24
24
getAllAvailableLocales = function ( ) {
25
25
localesList = [ ] ;
26
- Object . keys ( bundles ) . forEach ( function ( name ) {
26
+ bundlesList . forEach ( function ( name ) {
27
27
var root = require ( getMasterMid ( name ) ) ;
28
28
29
29
eachProp ( root , function ( loc ) {
@@ -82,7 +82,7 @@ define(["./common"], function (common) {
82
82
83
83
return {
84
84
addBundleToNlsLayer : function ( name ) {
85
- bundles [ name ] = true ;
85
+ bundlesList . push ( name ) ;
86
86
} ,
87
87
88
88
setLocalesList : function ( locList ) {
@@ -93,15 +93,15 @@ define(["./common"], function (common) {
93
93
} ,
94
94
95
95
reset : function ( ) {
96
- bundles = { } ;
96
+ bundlesList = [ ] ;
97
97
localesList = undefined ;
98
98
layerMid = undefined ;
99
99
} ,
100
100
101
101
getLayersContent : function ( ) {
102
102
var layersContent = { } ;
103
103
104
- Object . keys ( bundles ) . forEach ( function ( name ) {
104
+ bundlesList . forEach ( function ( name ) {
105
105
var root = normalizeRoot ( require ( getMasterMid ( name ) ) , name ) ,
106
106
pseudoRoots = getPseudoRoots ( root ) ;
107
107
@@ -134,7 +134,7 @@ define(["./common"], function (common) {
134
134
} ,
135
135
136
136
writeConfig : function ( pluginName , data , write ) {
137
- var bundlesList = Object . keys ( bundles ) . map ( getMasterMid ) ,
137
+ var bundles = bundlesList . map ( getMasterMid ) ,
138
138
layerMid = getLayerMid ( data ) ,
139
139
i18nConf = {
140
140
config : { }
@@ -143,7 +143,7 @@ define(["./common"], function (common) {
143
143
bundlesMap : { } ,
144
144
localesMap : { }
145
145
} ;
146
- i18nConf . config [ pluginName ] . bundlesMap [ layerMid ] = bundlesList ;
146
+ i18nConf . config [ pluginName ] . bundlesMap [ layerMid ] = bundles ;
147
147
i18nConf . config [ pluginName ] . localesMap [ layerMid ] = localesList ;
148
148
149
149
// write i18n config on the layer
0 commit comments