summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-01-17 13:13:36 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2013-01-17 13:13:36 +0100
commit52c4af9cd8617c38053f92ea473e9d5c10281479 (patch)
tree3f260eeb8ca1cb3974c688b8a0917f67ccbb2713 /Bugzilla.pm
parentd8643908a7d6243c361e670573af763067db408d (diff)
downloadbugzilla-52c4af9cd8617c38053f92ea473e9d5c10281479.tar.gz
bugzilla-52c4af9cd8617c38053f92ea473e9d5c10281479.tar.xz
Bug 830467: Don't call _wanted_languages() when only one is available
r=glob a=LpSolit
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 985834876..0681b83c7 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -28,7 +28,7 @@ use Bugzilla::Extension;
use Bugzilla::DB;
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;
@@ -420,6 +420,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) {
@@ -912,6 +916,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.