[i18n] Fix a strange behavior when set user language to default-sys-lang

stable
David Barragán Merino 2015-05-12 20:45:05 +02:00
parent 219b439ff2
commit 8ec8fd0198
1 changed files with 5 additions and 4 deletions

View File

@ -35,15 +35,16 @@ class AuthService extends taiga.Service
"$tgResources",
"$tgHttp",
"$tgUrls",
"$tgConfig",
"$translate"]
constructor: (@rootscope, @storage, @model, @rs, @http, @urls, @translate) ->
constructor: (@rootscope, @storage, @model, @rs, @http, @urls, @config, @translate) ->
super()
_setLocales: ->
if @rootscope.user.lang
@translate.use(@rootscope.user.lang)
moment.locale(@rootscope.user.lang)
lang = @rootscope.user.lang || @config.get("defaultLanguage") || "en"
@translate.use(lang)
moment.locale(lang)
getUser: ->
if @rootscope.user