profile: store preferred language in the database

This commit is contained in:
Girish Ramakrishnan
2024-02-26 12:32:14 +01:00
parent 6d6107161e
commit 6525504923
10 changed files with 150 additions and 14 deletions
+6 -1
View File
@@ -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 () {