X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=data%2Frbot%2Fplugins%2Ftranslator.rb;h=933969a1a7f1aa62ffb388fefcf41f5a96443309;hb=052217de30c59206d7025b582d4604557a747470;hp=c4eaac4ff80c7cdcd1c414183efe89467d287220;hpb=b218f003e2625c2b9ebc9de39886fb2f54d68aa0;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb index c4eaac4f..933969a1 100644 --- a/data/rbot/plugins/translator.rb +++ b/data/rbot/plugins/translator.rb @@ -382,7 +382,7 @@ class TranslatorPlugin < Plugin translator = @default_translators.find {|t| @translators[t].support?(params[:from], params[:to])} if translator - cmd_translate m, params.merge({:translator => translator, :show_provider => true}) + cmd_translate m, params.merge({:translator => translator, :show_provider => false}) else # When translate command is used without source language, "auto" as source # language is assumed. It means that google translator is used and we let google @@ -453,10 +453,10 @@ end plugin = TranslatorPlugin.new req = Hash[*%w(from to).map { |e| [e.to_sym, /#{plugin.languages.join("|")}/] }.flatten] -plugin.map 'translate [:from] [:to] *url', - :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://.*}) -plugin.map 'translator [:from] [:to] *url', - :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://.*}) +plugin.map 'translate [:from] [:to] :url', + :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://[^\s]*}) +plugin.map 'translator [:from] [:to] :url', + :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://[^\s]*}) plugin.map 'translate [:from] [:to] *phrase', :action => :cmd_translator, :thread => true, :requirements => req plugin.map 'translator [:from] [:to] *phrase',