summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-07-14 13:24:33 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2012-07-14 13:24:33 +0200
commit3342d4b9a510655d320590f7333f616355d0201d (patch)
treea1eab0ba1796e6b95cf0c864dae0ff485967582d /lib
parentafb3499af63d7011d2054ac0a6ec4dd0124061be (diff)
Update gettext support
Somewhere along the line between 2.0.0 and 2.2.1 gettext switched from locale to lang for the hash key name. Support both.
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/load-gettext.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rbot/load-gettext.rb b/lib/rbot/load-gettext.rb
index ba9b09ba..252e1e34 100644
--- a/lib/rbot/load-gettext.rb
+++ b/lib/rbot/load-gettext.rb
@@ -29,7 +29,11 @@ end
include GetText
- rbot_locale_path = File.join(Irc::Bot::Config.datadir, "../locale/%{locale}/LC_MESSAGES/%{name}.mo")
+ rbot_locale_path = File.join(Irc::Bot::Config.datadir,
+ gettext_version < [2, 2, 0] ?
+ "../locale/%{locale}/LC_MESSAGES/%{name}.mo" :
+ "../locale/%{lang}/LC_MESSAGES/%{name}.mo")
+
if gettext_version < [2, 0, 0]
add_default_locale_path(rbot_locale_path)
else