diff --git a/docs/changelog/5.x.x.txt b/docs/changelog/5.x.x.txt index 3603be2f2..d925be00b 100644 --- a/docs/changelog/5.x.x.txt +++ b/docs/changelog/5.x.x.txt @@ -1,7 +1,7 @@ 5.5.1 - Fixed bug #829806 preventing users from updating thier passwords from the updateAccount form. - Added Apache 2 instructions to install.txt. (Thanks to Andy Grundman.) - + - Fixed bug [ 831628 ] Subscription notifications sent in wrong language. 5.5.0 - Rewrote the discussion system and added many new features in the process. diff --git a/lib/WebGUI/Forum/UI.pm b/lib/WebGUI/Forum/UI.pm index 81c02cfe4..1ce267289 100644 --- a/lib/WebGUI/Forum/UI.pm +++ b/lib/WebGUI/Forum/UI.pm @@ -1329,14 +1329,19 @@ sub notifySubscribers { $subscribers{$userId} = $userId unless ($userId == $post->get("userId")); # make sure we don't send unnecessary messages } $sth->finish; - my $var = { - 'notify.subscription.message' => WebGUI::International::get(875) - }; - $var = getPostTemplateVars($post, $thread, $forum, $callback, $var); - my $subject = WebGUI::International::get(523); - my $message = WebGUI::Template::process(WebGUI::Template::get($forum->get("notificationTemplateId"),"Forum/Notification"), $var); + my %lang; foreach my $userId (keys %subscribers) { - WebGUI::MessageLog::addEntry($userId,"",$subject,$message); + my $u = WebGUI::User->new($userId); + unless (exists $lang{$u->get("language")}) { + $lang{$u->get("language")}{var} = { + 'notify.subscription.message' => WebGUI::International::get(875,$u->get("language")) + }; + $lang{$u->get("language")}{var} = getPostTemplateVars($post, $thread, $forum, $callback, $lang{$u->get("language")}{var}); + $lang{$u->get("language")}{subject} = WebGUI::International::get(523,$u->get("language")); + $lang{$u->get("language")}{message} = WebGUI::Template::process(WebGUI::Template::get($forum->get("notificationTemplateId"),"Forum/Notification"), + $lang{$u->get("language")}{var}); + } + WebGUI::MessageLog::addEntry($userId,"",$lang{$u->get("language")}{subject},$lang{$u->get("language")}{message}); } }