X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frbot%2Fconfig.rb;h=de7b29b78719a90d038ed1f9db44dc4c06d1e566;hb=6fc9e6c2e1895018b89f45494384015b6b365a81;hp=a1762988c98aab3d22b0c292fa1c7bfa0949328a;hpb=1a42c5ca1d7caad19f5ad26b4dad51731d597e8d;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/config.rb b/lib/rbot/config.rb index a1762988..de7b29b7 100644 --- a/lib/rbot/config.rb +++ b/lib/rbot/config.rb @@ -169,7 +169,7 @@ module Irc string end def desc - "#{@desc} [valid values are: " + values.join(", ") + "]" + _("%{desc} [valid values are: %{values}]") % {:desc => @desc, :values => values.join(', ')} end end @@ -238,7 +238,7 @@ module Irc # return @config[key] # end if @config.has_key?(key.to_sym) - warning "Unregistered lookup #{key.to_sym.inspect}" + warning _("Unregistered lookup #{key.to_sym.inspect}") return @config[key.to_sym] end return false @@ -301,18 +301,16 @@ module Irc end def run() - puts "First time rbot configuration wizard" + puts _("First time rbot configuration wizard") puts "====================================" - puts "This is the first time you have run rbot with a config directory of:" - puts @bot.botclass - puts "This wizard will ask you a few questions to get you started." - puts "The rest of rbot's configuration can be manipulated via IRC once" - puts "rbot is connected and you are auth'd." + puts _("This is the first time you have run rbot with a config directory of: #{@bot.botclass}") + puts _("This wizard will ask you a few questions to get you started.") + puts _("The rest of rbot's configuration can be manipulated via IRC once rbot is connected and you are auth'd.") puts "-----------------------------------" return unless @questions @questions.sort{|a,b| a.order <=> b.order }.each do |q| - puts q.desc + puts _(q.desc) begin print q.key.to_s + " [#{q.to_s}]: " response = STDIN.gets @@ -320,10 +318,10 @@ module Irc unless response.empty? q.set_string response, false end - puts "configured #{q.key} => #{q.to_s}" + puts _("configured #{q.key} => #{q.to_s}") puts "-----------------------------------" rescue ArgumentError => e - puts "failed to set #{q.key}: #{e.message}" + puts _("failed to set #{q.key}: #{e.message}") retry end end