can change language from setting

This commit is contained in:
Matteo Pagliazzi
2013-11-12 16:13:35 +01:00
parent 154a652726
commit 5ddf54466c
3 changed files with 16 additions and 0 deletions

View File

@@ -33,6 +33,17 @@ habitrpg.controller('SettingsCtrl',
User.log({'op':'set', data:{'preferences.dayStart': dayStart}});
}
$scope.language = window.env.language;
$scope.avalaibleLanguages = window.env.avalaibleLanguages;
$scope.changeLanguage = function(){
User.set('preferences.language', $scope.language);
// FIXME we wait 1sec hoping that in the meantime the server has responded to the `set`
setTimeout(function(){
location.reload();
}, 1000);
}
$scope.reroll = function(){
$http.post(API_URL + '/api/v1/user/reroll')