]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/cfgroot/lang.pl
update Tor to 0.3.5.8
[people/pmueller/ipfire-2.x.git] / config / cfgroot / lang.pl
index 3b001ad9d433ad2fe354e29369f017294dcd5137..2b09c4a9ff44ab4baf05b3e7439b218c35a28d2b 100644 (file)
@@ -169,6 +169,9 @@ sub FindWebLanguage() {
        my ($language, $country) = split(/_/, $shortlang);
        push(@options, $language);
 
+       # Add English as fallback
+       push(@options, "en");
+
        foreach my $option (@options) {
                return $option if (-e "${General::swroot}/langs/$option.pl");
        }
@@ -176,4 +179,18 @@ sub FindWebLanguage() {
        return undef;
 }
 
+sub DetectBrowserLanguages() {
+       my $langs = $ENV{"HTTP_ACCEPT_LANGUAGE"};
+       my @results = ();
+
+       foreach my $lang (split /[,;]/, $langs) {
+               # Drop all q= arguments
+               next if ($lang =~ m/^q=/);
+
+               push(@results, $lang);
+       }
+
+       return @results;
+}
+
 1;