This project is archived and is in readonly mode.
Move 1.9 string interpolation syntax backport from I18n to ActiveSupport
Reported by Sven Fuchs | November 19th, 2010 @ 08:41 AM | in 3.0.6
In I18n we've shipped a String#% patch for a number of versions which backports 1.9's string interpolation syntax to 1.8. At some point Rails started relying on this behavior so it seems appropriate to move it to ActiveSupport (where people most likely will look for such extensions).
In I18n itself we're going to not rely on this patch anymore but implement our own version of I18n.interpolate, mostly in order to get rid of warnings (and in debug mode exceptions) that are raised when optional interpolation variables are passed. (Optional interpolation variables are something we absolutely need in I18n but seems to be seen as a wrong usage of sprintf by Ruby core.)
Here's a patch that moves this functionality to ActiveSupport:
https://github.com/svenfuchs/rails/commit/85a05662fe7e0b06e9c7cd93c...
I'm not really sure about how to properly attribute Masao's work in a case like this. What exactly should be there? (I've just linked the original work for now.)
Comments and changes to this ticket
-
Andrés Mejía November 22nd, 2010 @ 05:49 PM
+1 for this. I get those I18n warnings all around when running Rails tests. Would love to see them gone.
-
Santiago Pastorino February 27th, 2011 @ 03:15 AM
- Milestone changed from 3.0.5 to 3.0.6
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>