From 5a10ebe6514918f89e60e0dc43fa19ebe06c03be Mon Sep 17 00:00:00 2001 From: "wurblzap%gmail.com" <> Date: Tue, 2 Jun 2009 22:00:10 +0000 Subject: Bug 457657 – Make e-mail comment header localizable. Patch by Marc Schumann , r/a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Bug.pm | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 79cf1dd5e..f1fc9c424 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3060,29 +3060,15 @@ sub GetComments { return \@comments; } -# Format language specific comments. This routine must not update -# $comment{'body'} itself, see BugMail::prepare_comments(). +# Format language specific comments. sub format_comment { my $comment = shift; + my $template = Bugzilla->template_inner; + my $vars = {comment => $comment}; my $body; - if ($comment->{'type'} == CMT_DUPE_OF) { - $body = $comment->{'body'} . "\n\n" . - get_text('bug_duplicate_of', { dupe_of => $comment->{'extra_data'} }); - } - elsif ($comment->{'type'} == CMT_HAS_DUPE) { - $body = get_text('bug_has_duplicate', { dupe => $comment->{'extra_data'} }); - } - elsif ($comment->{'type'} == CMT_POPULAR_VOTES) { - $body = get_text('bug_confirmed_by_votes'); - } - elsif ($comment->{'type'} == CMT_MOVED_TO) { - $body = $comment->{'body'} . "\n\n" . - get_text('bug_moved_to', { login => $comment->{'extra_data'} }); - } - else { - $body = $comment->{'body'}; - } + $template->process("bug/format_comment.txt.tmpl", $vars, \$body) + || ThrowTemplateError($template->error()); return $body; } -- cgit v1.2.3-24-g4f1b