]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/language.rb
plugin(points): +/- must come after, closes #34
[user/henk/code/ruby/rbot.git] / lib / rbot / language.rb
index cb08324409a468f4aa0d6361bbc10f54482ce904..8055ea0e8e986ae588ff624408617daef803d0f0 100644 (file)
@@ -11,6 +11,9 @@ module Irc
 class Bot
   class Language
 
+    # Access needed for tests:
+    attr_reader :strings
+
     # This constant hash holds the mapping
     # from long language names to the usual POSIX
     # locale specifications
@@ -24,6 +27,7 @@ class Bot
       :dutch    => 'nl',
       :japanese => 'ja',
       :russian  => 'ru',
+      :finnish  => 'fi',
       :traditional_chinese => 'zh_TW',
       :simplified_chinese => 'zh_CN'
     }
@@ -77,7 +81,7 @@ class Bot
       lang_str = language.to_s.downcase.gsub(/\s+/,'_')
       lang_sym = lang_str.intern
       if defined?(GetText) and Lang2Locale.key?(lang_sym)
-        setlocale(Lang2Locale[lang_sym])
+        GetText.set_locale(Lang2Locale[lang_sym])
         debug "locale set to #{locale}"
         rbot_gettext_debug
       else