]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/babel.pl
nl
[infobot.git] / src / Modules / babel.pl
index 56dc42797dc50da2fd18d0a80888fbb50abb73b8..d3543ce61c2b02f681aaa573462a2127a156693b 100644 (file)
@@ -42,6 +42,7 @@ BEGIN {
                'jp' => 'ja',
                'ko' => 'ko',
                'kr' => 'ko',
+               'nl' => 'nl',
                'ru' => 'ru'
               );
 
@@ -61,7 +62,7 @@ sub babelfish {
   my $ua = new LWP::UserAgent;
   $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy"));
   # Let's pretend
-  $ua->agent("Mozilla/4.5 " . $ua->agent);
+  $ua->agent("Mozilla/5.0 " . $ua->agent);
   $ua->timeout(5);
 
   my $req =
@@ -72,6 +73,7 @@ sub babelfish {
 # Accept-Charset: iso-8859-1
 #  $req->header('Accept-Charset' => 'iso-8859-1');
 #  print $req->header('Accept-Charset');
+  $req->header('Accept-Language' => 'en');
   $req->content_type('application/x-www-form-urlencoded');
 
   return translate($phrase, "${from}_${to}", $req, $ua);
@@ -107,7 +109,7 @@ sub translate {
       &main::DEBUG("$translated\n===remove to first ':', optional Help\n");
 
       $translated =~ s/\n/ /g;
-      # FIXME should we do unicode->iso
+      # FIXME: should we do unicode->iso (no. use utf8!)
   } else {
       $translated = ":("; # failure
   }