[i18n] Minor refactor

stable
David Barragán Merino 2015-05-18 13:16:52 +02:00
parent 89665dca59
commit c2f6401b80
1 changed files with 37 additions and 35 deletions

View File

@ -249,20 +249,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
if not window.taigaConfig.debugInfo
$translateProvider.fallbackLanguage(preferedLangCode)
moment.locale(preferedLangCode)
init = ($log, $config, $rootscope, $auth, $events, $analytics, $translate) ->
$log.debug("Initialize application")
# Taiga Plugins
$rootscope.contribPlugins = @.taigaContribPlugins
$rootscope.adminPlugins = _.where(@.taigaContribPlugins, {"type": "admin"})
# i18n
$rootscope.$on "$translateChangeEnd", (ctx) ->
lang = ctx.language
i18nInit = (lang, $translate) ->
# i18n - moment.js
moment.locale(lang)
@ -296,6 +284,20 @@ init = ($log, $config, $rootscope, $auth, $events, $analytics, $translate) ->
}
checksley.updateMessages('default', messages)
init = ($log, $config, $rootscope, $auth, $events, $analytics, $translate) ->
$log.debug("Initialize application")
# Taiga Plugins
$rootscope.contribPlugins = @.taigaContribPlugins
$rootscope.adminPlugins = _.where(@.taigaContribPlugins, {"type": "admin"})
# i18n
#$rootscope.$on "$translateChangeEnd", (ctx) ->
$rootscope.$on "$translateLoadingEnd'", (ctx) ->
lang = ctx.language
i18nInit(lang, $translate)
# Load user
if $auth.isAuthenticated()
$events.setupConnection()