This project is archived and is in readonly mode.

#6013 new
Sven Fuchs

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

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>

Pages