diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-03-11 02:23:24 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-03-11 12:08:30 +0100 |
commit | 120ab566aa0394e3386af89c1ed4776c13433ef8 (patch) | |
tree | 694e0c8c808a550da0224389cd900fe1b0d5785d /lib/rbot | |
parent | 78cea25b77b40a3d3c40f38fa876176875492850 (diff) |
gettext: undefine GetText if we failed to load properly
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/load-gettext.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |