Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
52c4af9c
Commit
52c4af9c
authored
Jan 17, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 830467: Don't call _wanted_languages() when only one is available
r=glob a=LpSolit
parent
d8643908
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
Bugzilla.pm
Bugzilla.pm
+9
-1
Util.pm
Bugzilla/Install/Util.pm
+4
-2
Template.pm
Bugzilla/Template.pm
+3
-8
No files found.
Bugzilla.pm
View file @
52c4af9c
...
...
@@ -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.
...
...
Bugzilla/Install/Util.pm
View file @
52c4af9c
...
...
@@ -371,7 +371,10 @@ sub include_languages {
# Basically, the way this works is that we have a list of languages
# that we *want*, and a list of languages that Bugzilla actually
# supports.
# supports. If there is only one language installed, we take it.
my
$supported
=
supported_languages
();
return
@$supported
if
@$supported
==
1
;
my
$wanted
;
if
(
$params
->
{
language
})
{
# We can pass several languages at once as an arrayref
...
...
@@ -382,7 +385,6 @@ sub include_languages {
else
{
$wanted
=
_wanted_languages
();
}
my
$supported
=
supported_languages
();
my
$actual
=
_wanted_to_actual_languages
(
$wanted
,
$supported
);
return
@$actual
;
}
...
...
Bugzilla/Template.pm
View file @
52c4af9c
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment