]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/translator.rb
hangman: make replies more compatible with gettext
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / translator.rb
index 39d3c1fe618ff676b412ed3de6c51867e391f965..0e09cb4855e717dd81473ead737443331570accd 100644 (file)
@@ -39,7 +39,7 @@ class Translator
     @cache = cache
   end
 
+
   # whether the translator supports this direction
   def support?(from, to)
     from != to && @directions[from].include?(to)
@@ -230,13 +230,13 @@ class BabelfishTranslator < Translator
   end
 
   def do_translate(text, from, to)
-    if @form.fields_with(:name => 'trtext').first.empty?
+    if @form.fields_with(:name => 'trtext').empty?
       @form.add_field!('trtext', text)
     else
       @form.fields_with(:name => 'trtext').first.value = text
     end
     @lang_list.value = "#{from}_#{to}"
-    @form.submit.parser.search("td.s/div[@style]").inner_html
+    @form.submit.parser.search("div[@id='result']/div[@style]").inner_html
   end
 end
 
@@ -316,7 +316,7 @@ class TranslatorPlugin < Plugin
   end
 
   def update_default
-    @default_translators = bot.config['translator.default_list'] & @translators.keys 
+    @default_translators = bot.config['translator.default_list'] & @translators.keys
   end
 
   def cmd_translator(m, params)