From 7a758a657e10c5b6a11355c9dad205178342096f Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 27 Jan 2012 13:15:34 +0000 Subject: Add examples of how a user might customise: * routes * gettext translations * categories --- lib/gettext_setup.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/gettext_setup.rb (limited to 'lib/gettext_setup.rb') 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 + + + -- cgit v1.2.3