Permalink
Browse files

Make sure mailouts are in the user's chosen language

  • Loading branch information...
1 parent 5319c6a commit a5a4cd60cbc5b3711af12faff28099e402fd9bb7 martin committed Sep 21, 2002
Showing with 7 additions and 1 deletion.
  1. +2 −0 mod/assignment/lib.php
  2. +3 −1 mod/forum/lib.php
  3. +2 −0 mod/journal/lib.php
@@ -128,6 +128,8 @@ function assignment_cron () {
continue;
}
+ $USER->lang = $user->lang;
+
if (! $course = get_record("course", "id", "$submission->course")) {
echo "Could not find course $submission->course\n";
continue;
View
@@ -904,17 +904,19 @@ function forum_cron () {
}
if ($users = forum_subscribed_users($course, $forum)) {
- $strforums = get_string("forums", "forum");
$canunsubscribe = ! forum_is_forcesubscribed($forum->id);
$mailcount=0;
foreach ($users as $userto) {
$USER->lang = $userto->lang; // Affects the language of get_string
+
$by->name = "$userfrom->firstname $userfrom->lastname";
$by->date = userdate($post->created, "", $userto->timezone);
$strbynameondate = get_string("bynameondate", "forum", $by);
+ $strforums = get_string("forums", "forum");
+
$postsubject = "$course->shortname: $post->subject";
$posttext = "$course->shortname -> $strforums -> $forum->name";
View
@@ -67,6 +67,8 @@ function journal_cron () {
continue;
}
+ $USER->lang = $user->lang;
+
if (! $course = get_record("course", "id", "$entry->course")) {
echo "Could not find course $entry->course\n";
continue;

0 comments on commit a5a4cd6

Please sign in to comment.