aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gettext_setup.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gettext_setup.rb')
-rw-r--r--lib/gettext_setup.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gettext_setup.rb b/lib/gettext_setup.rb
new file mode 100644
index 0000000..5b7a455
--- /dev/null
+++ b/lib/gettext_setup.rb
@@ -0,0 +1,14 @@
+# Add a callback - to be executed before each request in development,
+# and at startup in production - to plug in theme locale strings.
+require 'dispatcher'
+Dispatcher.to_prepare do
+ repos = [
+ FastGettext::TranslationRepository.build('app', :path=>File.join(File.dirname(__FILE__), '..', 'locale-theme'), :type => :po),
+ FastGettext::TranslationRepository.build('app', :path=>'locale', :type => :po)
+ ]
+ FastGettext.add_text_domain 'app', :type=>:chain, :chain=>repos
+ FastGettext.default_text_domain = 'app'
+end
+
+
+