X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frbot%2Flanguage.rb;h=8055ea0e8e986ae588ff624408617daef803d0f0;hb=8218e3f05e8ccd95497dd3c7aa115cfde8b01a40;hp=cb08324409a468f4aa0d6361bbc10f54482ce904;hpb=783ffa4235330029d661752b1023db635b26f2b3;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/language.rb b/lib/rbot/language.rb index cb083244..8055ea0e 100644 --- a/lib/rbot/language.rb +++ b/lib/rbot/language.rb @@ -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