Commit 41e92d90 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Update the session language on change of user preference"

parents 39f657fe c7303c7e
......@@ -287,6 +287,9 @@ function accountprefs_submit(Pieform $form, $values) {
db_commit();
if (isset($values['lang']) && $values['lang'] != $oldlang) {
// The session language pref is used when the user has no user pref,
// and when logged out.
$SESSION->set('lang', $values['lang']);
// Use PIEFORM_CANCEL here to force a page reload and show the new language.
$returndata['location'] = get_config('wwwroot') . 'account/index.php';
$SESSION->add_ok_msg(get_string_from_language($values['lang'], 'prefssaved', 'account'));
......
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 to comment