X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frbot%2Flanguage.rb;h=8055ea0e8e986ae588ff624408617daef803d0f0;hb=07a397f63f0c7dc7f53830a57ce9048cfd9efb53;hp=ae750ad93868b6dc498c2a9b1d2fe1e7877f36ce;hpb=1ac529cac1536e4f05bdef10cc6b387b45be74c7;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/language.rb b/lib/rbot/language.rb index ae750ad9..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 @@ -78,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