From: lpsolit%gmail.com <> Date: Tue, 12 Dec 2006 02:00:46 +0000 (+0000) Subject: Bug 297186: Send emails in the recipient's locale, not the current user's - Patch... X-Git-Tag: bugzilla-2.23.4~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32f3ff65a8019fded30601f59f37306312576547;p=thirdparty%2Fbugzilla.git Bug 297186: Send emails in the recipient's locale, not the current user's - Patch by Frédéric Buclin r=bkor a=justdave --- diff --git a/Bugzilla.pm b/Bugzilla.pm index 32f731859c..f278adb2e9 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -146,14 +146,17 @@ init_page() if !$ENV{MOD_PERL}; sub template { my $class = shift; + request_cache()->{language} = ""; request_cache()->{template} ||= Bugzilla::Template->create(); return request_cache()->{template}; } sub template_inner { - my $class = shift; - $class->request_cache->{template_inner} ||= Bugzilla::Template->create(); - return $class->request_cache->{template_inner}; + my ($class, $lang) = @_; + $lang = defined($lang) ? $lang : (request_cache()->{language} || ""); + request_cache()->{language} = $lang; + request_cache()->{"template_inner_$lang"} ||= Bugzilla::Template->create(); + return request_cache()->{"template_inner_$lang"}; } sub cgi { @@ -497,7 +500,10 @@ The current C