From 8ec8fd019814cf1aa9ba8d8a6708acd93d931656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Tue, 12 May 2015 20:45:05 +0200 Subject: [PATCH] [i18n] Fix a strange behavior when set user language to default-sys-lang --- app/coffee/modules/auth.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index e70207b6..42b9a5dd 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -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