profile: store preferred language in the database
This commit is contained in:
@@ -15,7 +15,12 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
|
||||
|
||||
$scope.$watch('language', function (newVal, oldVal) {
|
||||
if (newVal === oldVal) return;
|
||||
$translate.use(newVal.id);
|
||||
|
||||
Client.setProfileLanguage(newVal.id, function (error) {
|
||||
if (error) return console.error('Failed to reset password:', error);
|
||||
});
|
||||
|
||||
$translate.use(newVal.id); // this switches the language and saves locally in localStorage['NG_TRANSLATE_LANG_KEY']
|
||||
});
|
||||
|
||||
$scope.sendPasswordReset = function () {
|
||||
|
||||
Reference in New Issue
Block a user