aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gettext_setup.rb
blob: 879bf57dd1a2ef92072eb812351abec82f215167 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Add a callback - to be executed before each request in development,
# and at startup in production - to plug in theme locale strings.
Rails.configuration.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