+Support $W->{"language"}.
authorshort <>
Sat, 29 Jan 2005 20:28:35 +0000 (20:28 +0000)
committershort <>
Sat, 29 Jan 2005 20:28:35 +0000 (20:28 +0000)
Web.pm

diff --git a/Web.pm b/Web.pm
index 3e7f05e..99c0e0b 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -123,6 +123,7 @@ my($class,%args)=@_;
        do { $W->{$_}=1  if !defined $W->{$_}; } for ("indexme");
        do { $W->{$_}="" if !defined $W->{$_}; } for ("head");
        do { $W->{$_}="" if !defined $W->{$_}; } for ("head_css");
+       do { $W->{$_}="en-US" if !defined $W->{$_}; } for ("language");
 
        my $footer_any=0;
        for (qw(footer_mailme footer_ids)) {
@@ -698,6 +699,7 @@ my($class)=@_;
        my $client_charset=$W->{"force_charset"} || "us-ascii";
        header("Content-Style-Type"=>"text/css");
        header("Content-Script-Type"=>"text/javascript");
+       do { header("Content-Language"=>$_) if $_; } for $W->{"language"};
        $class->no_cache() if $W->{"no_cache"};
 
        while (my($key,$val)=each(%{$W->{"headers"}})) {
@@ -717,7 +719,8 @@ my($class)=@_;
                Wprint '<?xml version="1.0" encoding="'.$client_charset.'"?>'."\n";
                }
        Wprint '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n";
-       Wprint '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">'."\n";
+       Wprint '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'
+                       .($W->{"language"}||"en-US").'">'."\n";
        my $title=$W->{"title_prefix"}.join("",map({ ': '.$_; } ($W->{"title"} || ())));
        $title=~s#<[^>]*>##g;
        Wprint "<head>";