Fixing i18n in front
parent
0afb804a61
commit
d024162d6e
|
@ -22,9 +22,9 @@
|
||||||
taiga = @.taiga
|
taiga = @.taiga
|
||||||
|
|
||||||
class HttpService extends taiga.Service
|
class HttpService extends taiga.Service
|
||||||
@.$inject = ["$http", "$q", "$tgStorage", "$rootScope", "$cacheFactory"]
|
@.$inject = ["$http", "$q", "$tgStorage", "$rootScope", "$cacheFactory", "$translate"]
|
||||||
|
|
||||||
constructor: (@http, @q, @storage, @rootScope, @cacheFactory) ->
|
constructor: (@http, @q, @storage, @rootScope, @cacheFactory, @translate) ->
|
||||||
super()
|
super()
|
||||||
|
|
||||||
@.cache = @cacheFactory("httpget");
|
@.cache = @cacheFactory("httpget");
|
||||||
|
@ -37,7 +37,7 @@ class HttpService extends taiga.Service
|
||||||
headers["Authorization"] = "Bearer #{token}"
|
headers["Authorization"] = "Bearer #{token}"
|
||||||
|
|
||||||
# Accept-Language
|
# Accept-Language
|
||||||
lang = @rootScope.user?.lang
|
lang = @rootScope.user?.lang || @translate.preferredLanguage()
|
||||||
if lang
|
if lang
|
||||||
headers["Accept-Language"] = lang
|
headers["Accept-Language"] = lang
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ UserProfileDirective = ($confirm, $auth, $repo, $translate) ->
|
||||||
|
|
||||||
changeEmail = $scope.user.isAttributeModified("email")
|
changeEmail = $scope.user.isAttributeModified("email")
|
||||||
$scope.user.lang = $scope.lang
|
$scope.user.lang = $scope.lang
|
||||||
|
$translate.preferredLanguage($scope.lang)
|
||||||
|
|
||||||
onSuccess = (data) =>
|
onSuccess = (data) =>
|
||||||
$auth.setUser(data)
|
$auth.setUser(data)
|
||||||
|
|
Loading…
Reference in New Issue