Basically the question is: Should Rails as a framework automatically try to load any translations supplied by plugins and/or gems? Or should the developer be responsible for adding these manually?
I personally tend to solutions that give the developer more control by just requiring himself to do the right thing. I can see though that - as Rails loads the application's translations automatically - one would want the plugin translations to be loaded as well.
With engines being able to add functionality, I believe that this functionality will also need to be translated and it should be the responsibility of those providing the functionality, not the developer of the application.
In my opinion yes. Why not load automagically the translations path
when Rails is doing so with the routes.
With this what we achieve is that all engines will have the same
structure, so it will be easier for people to know where to look for
the translation files.
In the case of the engine I've been working on, I store the
translations using the same structure Rails does.
vendor/plugins/typus/lib/locales/typus/es.yml
At this moment, without supporting it, the developer has to manage
what to do when the engine is a gem.
if plugin?
I18n.load_path += Dir[File.join(root, 'config', 'locales', '**',
'*.{rb,yml}')]
else
Gem.path.each { |g| I18n.load_path += Dir[File.join("#{g}/gems/
*typus-#{version}/config/locales/**/*.{rb,yml}")] }
end
Basically the question is: Should Rails as a framework automatically
try to load any translations supplied by plugins and/or gems?
Yes, I think it should
I personally tend to solutions that give the developer more control by
just requiring himself to do the right thing.
Sure, but I'm not sure what the benefit would be in this case; and they could always put the in a non standard place and load them manually if they really want to