Add custom nested translation path to a rails engine

Posted Almost 9 years ago. Visible to the public.

In your engine's engine.rb file add these line:

module MyEngine
  class MyEngine < Rails::Engine
    config.before_initialize do                                                      
      config.i18n.load_path += Dir["#{config.root}/config/locales/**/*.yml"]
    end
  end
end

Bonyiii
Last edit
Almost 9 years ago
Bonyiii
Posted by Bonyiii to Bonyiii's deck (2015-05-21 11:35)