X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=src%2FModules%2Fbabel.pl;h=56dc42797dc50da2fd18d0a80888fbb50abb73b8;hb=f7cae48a17d6decd0a9bd997188271daa0a885b1;hp=720f4b0029a24d1045d71e6dbc46d15f4fd0b6a4;hpb=93eb520d8e5ebbdea3a20029d9d95e0d4e848901;p=infobot.git diff --git a/src/Modules/babel.pl b/src/Modules/babel.pl index 720f4b0..56dc427 100644 --- a/src/Modules/babel.pl +++ b/src/Modules/babel.pl @@ -27,23 +27,23 @@ BEGIN { # expects. use vars qw!%lang_code $lang_regex!; %lang_code = ( - 'fr' => 'fr', - 'sp' => 'es', - 'es' => 'es', - 'po' => 'pt', - 'pt' => 'pt', - 'it' => 'it', - 'ge' => 'de', - 'de' => 'de', - 'gr' => 'de', - 'en' => 'en', - 'zh' => 'zh', - 'ja' => 'ja', - 'jp' => 'ja', - 'ko' => 'ko', - 'kr' => 'ko', - 'ru' => 'ru' - ); + 'fr' => 'fr', + 'sp' => 'es', + 'es' => 'es', + 'po' => 'pt', + 'pt' => 'pt', + 'it' => 'it', + 'ge' => 'de', + 'de' => 'de', + 'gr' => 'de', + 'en' => 'en', + 'zh' => 'zh', + 'ja' => 'ja', + 'jp' => 'ja', + 'ko' => 'ko', + 'kr' => 'ko', + 'ru' => 'ru' + ); # Here's how we recognize the language you're asking for. It looks # like RTSL saves you a few keystrokes in #perl, huh? @@ -60,7 +60,8 @@ sub babelfish { my $ua = new LWP::UserAgent; $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy")); - $ua->agent("Mozilla/4.5 " . $ua->agent); # Let's pretend + # Let's pretend + $ua->agent("Mozilla/4.5 " . $ua->agent); $ua->timeout(5); my $req = @@ -115,11 +116,11 @@ sub translate { if (0) { if (-t STDIN) { - #my $result = babel::babelfish('en','sp','hello world'); - #my $result = babel::babelfish('en','sp','The cheese is old and moldy, where is the bathroom?'); - my $result = babel::babelfish('en','gr','doesn\'t seem to translate things longer than 40 characters'); - $result =~ s/; /\n/g; - print "Babelfish says: \"$result\"\n"; + #my $result = babel::babelfish('en','sp','hello world'); + #my $result = babel::babelfish('en','sp','The cheese is old and moldy, where is the bathroom?'); + my $result = babel::babelfish('en','gr','doesn\'t seem to translate things longer than 40 characters'); + $result =~ s/; /\n/g; + print "Babelfish says: \"$result\"\n"; } }