diff --git a/omega-web/src/coffee/options.coffee b/omega-web/src/coffee/options.coffee index d38385d..f2a08b1 100644 --- a/omega-web/src/coffee/options.coffee +++ b/omega-web/src/coffee/options.coffee @@ -18,28 +18,11 @@ $script.ready ['angular-loader'], -> $script.ready ['omega-pac'], -> $script 'js/omega.js', 'omega' - locales = - '': 'en-us' - - 'en': 'en-us' - - 'zh': 'zh-cn' - 'zh-hans': 'zh-cn' - 'zh-hant': 'zh-tw' - 'zh-cn': 'zh-cn' - 'zh-hk': 'zh-hk' - 'zh-tw': 'zh-tw' - - lang = navigator.language - lang1 = navigator.language?.split('-')[0] || '' - locale = locales[lang] || locales[lang1] || locales[''] - $script([ 'js/omega_target_web.js' 'js/omega_decoration.js' 'lib/angular-animate/angular-animate.min.js' 'lib/angular-bootstrap/ui-bootstrap-tpls.min.js' - 'lib/angular-i18n/angular-locale_' + locale + '.js' 'lib/ngprogress/ngProgress.min.js' 'lib/angular-ui-sortable/sortable.min.js' 'lib/angular-ui-utils/validate.min.js' @@ -59,7 +42,24 @@ $script.ready ['angular'], -> $script 'lib/angular-ui-router/angular-ui-router.min.js', 'angular-ui-router' $script 'lib/angular-sanitize/angular-sanitize.min.js', 'angular-sanitize' + locales = + '': 'en-us' + + 'en': 'en-us' + + 'zh': 'zh-cn' + 'zh-hans': 'zh-cn' + 'zh-hant': 'zh-tw' + 'zh-cn': 'zh-cn' + 'zh-hk': 'zh-hk' + 'zh-tw': 'zh-tw' + + lang = navigator.language + lang1 = navigator.language?.split('-')[0] || '' + locale = locales[lang] || locales[lang1] || locales[''] + $script 'lib/angular-i18n/angular-locale_' + locale + '.js', 'angular-i18n' + $script.ready ['angular', 'omega', 'omega-deps', 'angular-ui-router', 'jquery-ui', 'spectrum', 'filesaver', 'blob', 'angular-ladda', - 'angular-sanitize'], -> + 'angular-sanitize', 'angular-i18n'], -> angular.bootstrap document, ['omega']