summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-12-12 03:00:46 +0100
committerlpsolit%gmail.com <>2006-12-12 03:00:46 +0100
commit32f3ff65a8019fded30601f59f37306312576547 (patch)
tree3a5a3df17a0f49ab2b4dc32906238eaeb02eafbf /Bugzilla.pm
parent36540893adb1efd1a1fce5f2e115754f93442ca5 (diff)
downloadbugzilla-32f3ff65a8019fded30601f59f37306312576547.tar.gz
bugzilla-32f3ff65a8019fded30601f59f37306312576547.tar.xz
Bug 297186: Send emails in the recipient's locale, not the current user's - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor a=justdave
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 32f731859..f278adb2e 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<Template> object, to be used for output
=item C<template_inner>
If you ever need a L<Bugzilla::Template> object while you're already
-processing a template, use this.
+processing a template, use this. Also use it if you want to specify
+the language to use. If no argument is passed, it uses the last
+language set. If the argument is "" (empty string), the language is
+reset to the current one (the one used by Bugzilla->template).
=item C<cgi>