From 120ab566aa0394e3386af89c1ed4776c13433ef8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 11 Mar 2008 02:23:24 +0100 Subject: gettext: undefine GetText if we failed to load properly --- lib/rbot/load-gettext.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/rbot') diff --git a/lib/rbot/load-gettext.rb b/lib/rbot/load-gettext.rb index 6d739296..5738f197 100644 --- a/lib/rbot/load-gettext.rb +++ b/lib/rbot/load-gettext.rb @@ -59,6 +59,12 @@ begin rescue LoadError, GetTextVersionError warn "failed to load ruby-gettext package: #{$!}; translations are disabled" + # undefine GetText, in case it got defined because the error was caused by a + # wrong version + if defined?(GetText) + Object.module_eval { remove_const("GetText") } + end + # dummy functions that return msg_id without translation def _(s) s -- cgit v1.2.3