]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/language.rb
ircbot: sendmsg filtering
[user/henk/code/ruby/rbot.git] / lib / rbot / language.rb
index 7cf1ceb994982b0d88491192751dfdf4fc03c6cd..67114dac58277eb176b8340317a86f0901252c65 100644 (file)
@@ -8,6 +8,7 @@
 # .lang file etc.
 
 module Irc
+class Bot
   class Language
 
     # This constant hash holds the mapping
@@ -26,6 +27,8 @@ module Irc
       :traditional_chinese => 'zh_TW',
       :simplified_chinese => 'zh_CN'
     }
+    # On WIN32 it appears necessary to have ".UTF-8" explicitly for gettext to use UTF-8
+    Lang2Locale.each_value {|v| v.replace(v + '.UTF-8')}
 
     # Return the shortest language for the current
     # GetText locale
@@ -54,8 +57,8 @@ module Irc
       return 'english'
     end
 
-    BotConfig.register BotConfigEnumValue.new('core.language', 
-      :default => Irc::Language.from_locale, :wizard => true,
+    Config.register Config::EnumValue.new('core.language', 
+      :default => Irc::Bot::Language.from_locale, :wizard => true,
       :values => Proc.new{|bot|
             Dir.new(Config::datadir + "/languages").collect {|f|
               f =~ /\.lang$/ ? f.gsub(/\.lang$/, "") : nil
@@ -141,3 +144,4 @@ module Irc
   end
 
 end
+end