translate with supervisor.lang update

parent 095eb04b
......@@ -10,5 +10,15 @@ dashboardControllers.controller('TranslateController', function($translate, $sco
// Reload captcha according to language (only once instance per page, so id is always 0)
vcRecaptchaService.useLang(0, langKey.substr(0,2));
if ($window.sessionStorage.user) {
$http.put(config.backend + '/sup/' + supervisor.id, {lang: langKey})
.success(function (data) {
ngToast.success({ content: $translate.instant('data_saved') });
})
.error(function () {
ngToast.danger({ content: $translate.instant('data_no_saved') });
});
}
};
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment