Commit 7fa7a11e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Institution membership confirmation message in member's language

parent b3d22bb6
......@@ -221,6 +221,15 @@ class Institution {
if (is_numeric($user)) {
$user = get_record('usr', 'id', $user);
}
if ($user instanceof User) {
$lang = $user->get_account_preference('lang');
if (empty($lang) || $lang == 'default') {
$lang = get_config('lang');
}
}
else { // stdclass object
$lang = get_user_language($user->id);
}
$userinst = new StdClass;
$userinst->institution = $this->name;
$studentid = get_field('usr_institution_request', 'studentid', 'usr', $user->id,
......@@ -240,8 +249,8 @@ class Institution {
}
$message = (object) array(
'users' => array($user->id),
'subject' => get_string('institutionmemberconfirmsubject'),
'message' => get_string('institutionmemberconfirmmessage', 'mahara', $this->displayname),
'subject' => get_string_from_language($lang, 'institutionmemberconfirmsubject'),
'message' => get_string_from_language($lang, 'institutionmemberconfirmmessage', 'mahara', $this->displayname),
);
db_begin();
if (!get_config('usersallowedmultipleinstitutions')) {
......
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