Browse Source

fix loading of angular-locale in init.js

1. check for locale == defaultLocale for locale from ConfigStorage
2. the <script> needs to be added to the doom before setting the src
   attribute
master
Roman Anasal 10 years ago
parent
commit
4f317b4282
  1. 17
      app/js/init.js

17
app/js/init.js

@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
defaultLocale = 'en-us',
bootReady = {
dom: false,
i18n_ng: Config.I18n.locale == defaultLocale, // Already included
i18n_ng: locale == defaultLocale, // Already included
i18n_messages: false,
i18n_fallback: false
},
@ -114,13 +114,12 @@ @@ -114,13 +114,12 @@
}
if (!bootReady.i18n_ng) {
$('head').append($('<script>')
.on('load', function() {
bootReady.i18n_ng = true;
checkReady();
})
.attr('src', 'vendor/angular/i18n/angular-locale_' + Config.I18n.locale + '.js')
);
$('<script>').appendTo('head')
.on('load', function() {
bootReady.i18n_ng = true;
checkReady();
})
.attr('src', 'vendor/angular/i18n/angular-locale_' + Config.I18n.locale + '.js');
}
$.getJSON('js/locales/' + Config.I18n.locale + '.json').success(function (json) {
@ -145,4 +144,4 @@ @@ -145,4 +144,4 @@
checkReady();
});
});
})();
})();

Loading…
Cancel
Save