Commit a86a6d7d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use user lang pref in group membership type messages

parent 87f0a31a
......@@ -181,10 +181,11 @@ switch ($type) {
json_reply(true, get_string('memberchangefailed', 'group'));
}
require_once('activity.php');
$lang = get_user_language($user);
activity_occurred('maharamessage',
array('users' => array($user),
'subject' => get_string('groupmembershipchangesubject', 'group', $group->name),
'message' => get_string('groupmembershipchangemessage' . $v, 'group'),
'subject' => get_string_from_language($lang, 'groupmembershipchangesubject', 'group', $group->name),
'message' => get_string_from_language($lang, 'groupmembershipchangemessage' . $v, 'group'),
'url' => get_config('wwwroot') . 'group/view.php?id=' . $id));
}
......
......@@ -176,6 +176,16 @@ function get_account_preference($userid, $field) {
return $expected[$field];
}
function get_user_language($userid) {
$langpref = get_account_preference($userid, 'lang');
if (empty($langpref) || $langpref == 'default') {
return get_config('lang');
}
return $langpref;
}
/**
* default account settings
*
......
Supports Markdown
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