Add custom nested translation path to a rails engine

Posted . 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
Bonyiii
Posted by Bonyiii to Bonyiii's deck (2015-05-21 11:35)