summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorjustdave%syndicomm.com <>2002-08-17 13:40:50 +0200
committerjustdave%syndicomm.com <>2002-08-17 13:40:50 +0200
commit7891f2ead5f6f71cb2a10d71ad8c4cc98bf9a4d0 (patch)
treee1716aeffe0fa710666eb064714441d2a6c5e289 /globals.pl
parente9d56927daa4929f7f406c114730bb0730016602 (diff)
downloadbugzilla-7891f2ead5f6f71cb2a10d71ad8c4cc98bf9a4d0.tar.gz
bugzilla-7891f2ead5f6f71cb2a10d71ad8c4cc98bf9a4d0.tar.xz
Backing out patch for bug 126955 (supporting localized templates) due to fatal regression in checksetup.pl for initial
checkouts/clean installs. See comment 25 onward in bug for details.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl50
1 files changed, 1 insertions, 49 deletions
diff --git a/globals.pl b/globals.pl
index 6376b60f4..100c3ae2f 100644
--- a/globals.pl
+++ b/globals.pl
@@ -1567,54 +1567,6 @@ sub trim {
return $str;
}
-# Make an ordered list out of a HTTP Accept-Language header see RFC 2616, 14.4
-# We ignore '*' and <language-range>;q=0
-# For languages with the same priority q the order remains unchanged.
-sub sortAcceptLanguage {
- sub sortQvalue { $b->{'qvalue'} <=> $a->{'qvalue'} }
- my $accept_language = $_[0];
-
- # clean up string.
- $accept_language =~ s/[^A-Za-z;q=0-9\.\-,]//g;
- my @qlanguages;
- my @languages;
- foreach(split /,/, $accept_language) {
- my ($lang, $qvalue) = split /;q=/;
- next if not defined $lang;
- $qvalue = 1 if not defined $qvalue;
- next if $qvalue == 0;
- $qvalue = 1 if $qvalue > 1;
- push(@qlanguages, {'qvalue' => $qvalue, 'language' => $lang});
- }
-
- return map($_->{'language'}, (sort sortQvalue @qlanguages));
-}
-
-# Returns the path to the templates based on the Accept-Language
-# settings of the user and of the available languages
-# If no Accept-Language is present it uses the defined default
-sub getTemplateIncludePath () {
- my @languages = sortAcceptLanguage(Param('languages'));
- my @accept_language = sortAcceptLanguage($ENV{'HTTP_ACCEPT_LANGUAGE'} || "");
- my @usedlanguages;
- foreach my $lang (@accept_language) {
- # match exactly (case insensitive)
- if(my @found = grep /^$lang$/i, @languages) {
- push (@usedlanguages, $found[0]);
- }
- # Per RFC 1766 and RFC 2616 any language tag matches also its
- # primary tag. That is en-gb matches also en but not en-uk
- $lang =~ s/(-.*)//;
- if($1) {
- if(my @found = grep /^$lang$/i, @languages) {
- push (@usedlanguages, $found[0]);
- }
- }
- }
- push(@usedlanguages, Param('defaultlanguage'));
- return join(':', map("template/$_/custom:template/$_/default",@usedlanguages));
-}
-
###############################################################################
# Global Templatization Code
@@ -1632,7 +1584,7 @@ use Template;
$::template ||= Template->new(
{
# Colon-separated list of directories containing templates.
- INCLUDE_PATH => getTemplateIncludePath() ,
+ INCLUDE_PATH => "template/en/custom:template/en/default" ,
# Remove white-space before template directives (PRE_CHOMP) and at the
# beginning and end of templates and template blocks (TRIM) for better