summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-01-17 22:19:47 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-01-17 22:19:47 +0100
commit22f1b7eb4d32020ca57739266516705e7ece6457 (patch)
treec01f03d4a4addea9513260324a6c41e5a6647b63 /Bugzilla.pm
parentcd8de94df32638ec7d982d743171db809901205b (diff)
downloadbugzilla-22f1b7eb4d32020ca57739266516705e7ece6457.tar.gz
bugzilla-22f1b7eb4d32020ca57739266516705e7ece6457.tar.xz
Bug 830467 - Don't call _wanted_languages() when only one is available
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 28098cb65..5773eee63 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -47,7 +47,7 @@ use Bugzilla::DB;
use Bugzilla::Hook;
use Bugzilla::Install::Localconfig qw(read_localconfig);
use Bugzilla::Install::Requirements qw(OPTIONAL_MODULES);
-use Bugzilla::Install::Util qw(init_console);
+use Bugzilla::Install::Util qw(init_console include_languages);
use Bugzilla::Template;
use Bugzilla::User;
use Bugzilla::Error;
@@ -433,6 +433,10 @@ sub languages {
return Bugzilla::Install::Util::supported_languages();
}
+sub current_language {
+ return $_[0]->request_cache->{current_language} ||= (include_languages())[0];
+}
+
sub error_mode {
my ($class, $newval) = @_;
if (defined $newval) {
@@ -921,6 +925,10 @@ The main database handle. See L<DBI>.
Currently installed languages.
Returns a reference to a list of RFC 1766 language tags of installed languages.
+=item C<current_language>
+
+The currently active language.
+
=item C<switch_to_shadow_db>
Switch from using the main database to using the shadow database.