summaryrefslogtreecommitdiff
path: root/lib/rbot/language.rb
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-07-30 00:22:21 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-07-30 00:22:21 +0000
commit992ef2edbf3eed7cb1d7c4c22f72cd203aff2aa5 (patch)
treec34cc1bad75c9c226ac544fd4337e0acb5ac4a9b /lib/rbot/language.rb
parent676dd61e6b0bea5f506d064039a685944aefd6fb (diff)
Sat Jul 30 01:19:32 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* config module for configuring the running bot via IRC * BotConfig.register method for various modules and any plugin to register bot configuration which the new config module will expose for them. * various other tweaks as I continue to refactor..
Diffstat (limited to 'lib/rbot/language.rb')
-rw-r--r--lib/rbot/language.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rbot/language.rb b/lib/rbot/language.rb
index 64555248..ee6746d6 100644
--- a/lib/rbot/language.rb
+++ b/lib/rbot/language.rb
@@ -1,6 +1,13 @@
module Irc
class Language
+ BotConfig.register('core.language',
+ :default => "english", :type => :enum,
+ :values => Dir.new(Config::DATADIR + "/languages").collect {|f|
+ f =~ /\.lang$/ ? f.gsub(/\.lang$/, "") : nil
+ }.compact,
+ :desc => "Which language file the bot should use")
+
def initialize(language, file="")
@language = language
if file.empty?