aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gettext_setup.rb
blob: 5b7a455a215575a8ce0f6d5c55e13bbb3ea3d572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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