This project is archived and is in readonly mode.
i18n support for Engines
-
Sven Fuchs
- Assigned user set to Sven Fuchs
-
Francesc Esplugas
+1 to this. I added support for I18n on Typus about 8 months ago.
# Load translation files from the plugin or the gem. if plugin? I18n.load_path += Dir[File.join("#{Rails.root}/vendor/plugins/typus/config/locales/**/*.{rb,yml}")] else Gem.path.each { |g| I18n.load_path += Dir[File.join("#{g}/gems/*typus-#{version}/config/locales/**/*.{rb,yml}")] } endAs with the initializers, this would be a plus for developing engines.
-
Sven Fuchs
Discussing this on the rails-core mailinglist: http://groups.google.com/group/rubyonrails-core/browse_thread/threa...
-
Sven Fuchs
- Milestone changed from 2.x to 2.3.4
- State changed from new to open
- Assigned user changed from Sven Fuchs to Jeremy Kemper
Ok, people voted clearly 4:0 on this on the rails-core mailinglist. Nobody objected.
The commit from Antonio's fork does neither apply to current master nor 2-3-stable. Also, it potentially leaves a non-uniq I18n.load_path. I've fixed both issues and expanded the commit message a bit, but preserved Antonio's authorship.
Attached are two patches that apply to 2-3-stable and master respectively. Tests are passing on both branches.
Jeremy, I'll forward this ticket to you :)
-
Sven Fuchs
Crap. Wrong version of the 2-3-stable patch. Here's the right one. (Apparently I can't delete the previous version.)
-
Sven Fuchs
Ah, now it worked. Lighthouse caching issues. Sorry for the noise.
-
Repository
- State changed from open to committed
(from [cf4846c6ae991143afaef987a63c3ad9a3a2546b]) I18n support for plugins
Rails will now automatically add locale files found in any engine's locale
directory to the I18n.load_path (i.e. files that match the glob pattern
"config/locales/*/.{rb,yml}" relative to engine directories).[#2325 i18n support for Engines state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/cf4846c6ae991143afaef987a63c3a... -
Repository
(from [49342d1745dd0e6c4ebebe9e535e374783ac2c10]) I18n support for plugins
Rails will now automatically add locale files found in any engine's locale
directory to the I18n.load_path (i.e. files that match the glob pattern
"config/locales/*/.{rb,yml}" relative to engine directories).[#2325 i18n support for Engines state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/49342d1745dd0e6c4ebebe9e535e37... -
Sven Fuchs
Thanks, Jeremy :)
