This project is archived and is in readonly mode.
i18n support for Engines
Reported by Antonio Tapiador | March 24th, 2009 @ 02:00 PM | in 2.3.4
Localization files in myplugin/config/locales are added to I18n.load_path
Comments and changes to this ticket
-
Sven Fuchs July 8th, 2009 @ 11:38 PM
- Assigned user set to Sven Fuchs
-
Francesc Esplugas July 9th, 2009 @ 12:01 AM
+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}")] } end
As with the initializers, this would be a plus for developing engines.
-
Sven Fuchs August 26th, 2009 @ 12:39 PM
Discussing this on the rails-core mailinglist: http://groups.google.com/group/rubyonrails-core/browse_thread/threa...
-
Sven Fuchs August 30th, 2009 @ 02:13 PM
- 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 August 30th, 2009 @ 07:21 PM
Crap. Wrong version of the 2-3-stable patch. Here's the right one. (Apparently I can't delete the previous version.)
-
Sven Fuchs August 30th, 2009 @ 07:25 PM
Ah, now it worked. Lighthouse caching issues. Sorry for the noise.
-
Repository August 30th, 2009 @ 09:41 PM
- 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 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/cf4846c6ae991143afaef987a63c3a... -
Repository August 30th, 2009 @ 09:41 PM
(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 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/49342d1745dd0e6c4ebebe9e535e37...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2325 i18n support for Engines [#2325 state:committed]
- 2325 i18n support for Engines [#2325 state:committed]