X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Ftranslator.rb;h=0e09cb4855e717dd81473ead737443331570accd;hb=52c9564c96dbf95e5c883e41940527f2394ba55a;hp=39d3c1fe618ff676b412ed3de6c51867e391f965;hpb=99cbd0b632d330deab6f7b8891935841edd68313;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb index 39d3c1fe..0e09cb48 100644 --- a/data/rbot/plugins/translator.rb +++ b/data/rbot/plugins/translator.rb @@ -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)