]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
do not crash when GetText.cached= is not defined
authorYaohan Chen <yaohan.chen@gmail.com>
Sat, 12 Jul 2008 00:43:18 +0000 (20:43 -0400)
committerYaohan Chen <yaohan.chen@gmail.com>
Sat, 12 Jul 2008 00:43:18 +0000 (20:43 -0400)
lib/rbot/load-gettext.rb

index f2574af0cbe357a78a4e485d749ff7f20c6cb4e8..3eb7c30f9787d4e0e93d5c7a820c56b9b53705eb 100644 (file)
@@ -24,7 +24,11 @@ begin
 
   add_default_locale_path(File.join(Irc::Bot::Config.datadir, "../locale/%{locale}/LC_MESSAGES/%{name}.mo"))
 
-  GetText.cached = false
+  if GetText.respond_to? :cached=
+    GetText.cached = false
+  else
+    warning 'This version of ruby-gettext does not support non-cached mode; mo files are not reloaded when setting language'
+  end
   bindtextdomain 'rbot'
 
   module GetText