summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-08-27 22:16:10 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-08-27 22:16:10 +0000
commitbbf05f99728a39280a19d60cc428a40b2f094ce5 (patch)
treeb85b3c391721bb696a7f51ef0bd55bdbd6bce3b1
parente73fb21bbc3c947280cb884c8c48d642f8c7f6b2 (diff)
GetText: add Config.datadir-based locale search path.
This ensures that locale files are found regardless of rubygems being loaded or not
-rw-r--r--lib/rbot/ircbot.rb3
-rw-r--r--lib/rbot/load-gettext.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 72068a8e..98562d27 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -90,10 +90,9 @@ fatal "fatal test"
# The following global is used for the improved signal handling.
$interrupted = 0
-require 'rbot/load-gettext'
-
# these first
require 'rbot/rbotconfig'
+require 'rbot/load-gettext'
require 'rbot/config'
# require 'rbot/utils'
diff --git a/lib/rbot/load-gettext.rb b/lib/rbot/load-gettext.rb
index e6c605d9..e95d4068 100644
--- a/lib/rbot/load-gettext.rb
+++ b/lib/rbot/load-gettext.rb
@@ -22,6 +22,8 @@ begin
include GetText
+ add_default_locale_path(File.join(Irc::Config.datadir, "../locale/%{locale}/LC_MESSAGES/%{name}.mo"))
+
bindtextdomain 'rbot'
module GetText