]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/babel.pl
- findparam.pl now recognizes 'Identifier' conf settings.
[infobot.git] / src / Modules / babel.pl
index 7cca74ef52d61508f654a0237aca5f338b64db3c..0eb50c4aa988bb4fcce31321361d2226bd4bed9f 100644 (file)
@@ -61,7 +61,7 @@ sub babelfish {
        &::pSReply($xlate) if ($xlate);
        return;
     }
-    &DEBUG("what's this junk?");
+    &::DEBUG("what's this junk?");
 
     my $last_english = $phrase;
     my $last_lang;
@@ -88,6 +88,16 @@ sub translate {
     my $translated;
     if ($res->is_success) {            # success.
        my $html = $res->content;
+       my $textarea    = 0;
+       foreach (split "\n", $html) {
+           $textarea   = 1     if (/<textarea/i);
+           next unless ($textarea);
+
+           &::DEBUG("   '$_'");
+
+           $textarea   = 0     if (/<\/textarea/i);
+       }
+
        $html   =~ s/\cM//g;
        $html   =~ s/\n\s*\n/\n/g;
        $html   =~ s/\n/ /g;    # ...