my @wanted;
if ($params->{only_language}) {
- @wanted = ($params->{only_language});
+ # We can pass several languages at once as an arrayref
+ # or a single language.
+ if (ref $params->{only_language}) {
+ @wanted = @{ $params->{only_language} };
+ }
+ else {
+ @wanted = ($params->{only_language});
+ }
}
else {
@wanted = _sort_accept_language($ENV{'HTTP_ACCEPT_LANGUAGE'} || '');
sub template_include_path {
my ($params) = @_;
- my @used_languages = include_languages(@_);
+ my @used_languages = include_languages($params);
# Now, we add template directories in the order they will be searched:
my $template_dirs = _template_base_directories();
print install_string('template_precompile') if $output;
- my $paths = template_include_path({ use_languages => Bugzilla->languages });
+ my $paths = template_include_path({ use_languages => Bugzilla->languages,
+ only_language => Bugzilla->languages });
foreach my $dir (@$paths) {
my $template = Bugzilla::Template->create(include_path => [$dir]);