Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Daniel Weismüller <daniel.weismüller@ipfire.org>
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;
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
+# Load the most appropriate language from the browser configuration
+my @langs = &Lang::DetectBrowserLanguages();
+&Lang::reload(@langs);
+
my $coupons = "${General::swroot}/captive/coupons";
my %couponhash = ();