From 52c4af9cd8617c38053f92ea473e9d5c10281479 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 17 Jan 2013 13:13:36 +0100 Subject: Bug 830467: Don't call _wanted_languages() when only one is available r=glob a=LpSolit --- Bugzilla/Template.pm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index b93e1bfae..81d01b426 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -881,14 +881,9 @@ sub create { # Currently logged in user, if any # If an sudo session is in progress, this is the user we're faking 'user' => sub { return Bugzilla->user; }, - + # Currenly active language - # XXX Eventually this should probably be replaced with something - # like Bugzilla->language. - 'current_language' => sub { - my ($language) = include_languages(); - return $language; - }, + 'current_language' => sub { return Bugzilla->current_language; }, # If an sudo session is in progress, this is the user who # started the session. @@ -899,7 +894,7 @@ sub create { # Allow templates to access docs url with users' preferred language 'docs_urlbase' => sub { - my ($language) = include_languages(); + my $language = Bugzilla->current_language; my $docs_urlbase = Bugzilla->params->{'docs_urlbase'}; $docs_urlbase =~ s/\%lang\%/$language/; return $docs_urlbase; -- cgit v1.2.3-24-g4f1b