diff options
Diffstat (limited to 'lib/alavetelitheme.rb')
-rw-r--r-- | lib/alavetelitheme.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/alavetelitheme.rb b/lib/alavetelitheme.rb index 77b20de..2930ba6 100644 --- a/lib/alavetelitheme.rb +++ b/lib/alavetelitheme.rb @@ -24,11 +24,20 @@ end # Monkey patch app code for patch in ['controller_patches.rb', 'model_patches.rb', - 'patch_mailer_paths.rb', - 'gettext_setup.rb'] + 'patch_mailer_paths.rb'] require File.expand_path "../#{patch}", __FILE__ end # Note you should rename the file at "config/custom-routes.rb" to # something unique (e.g. yourtheme-custom-routes.rb": $alaveteli_route_extensions << 'custom-routes.rb' + +# Tell FastGettext about the theme's translations: look in the theme's +# locale-theme directory for a translation in the first place, and if +# it isn't found, look in the Alaveteli locale directory next: +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' |