Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Move 1.9 string interpolation syntax backport from I18n to ActiveSupport

#6013

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.)

Reported by Sven Fuchs · November 19th, 2010 @ 08:41 AM

State: new
Milestone: 3.0.6
Assigned to: nobody
Importance: Low

Activity

  1. Andrés Mejía
    Andrés Mejía

    +1 for this. I get those I18n warnings all around when running Rails tests. Would love to see them gone.

    November 22nd, 2010 @ 05:49 PM

  2. Jesse Storimer
  3. Santiago Pastorino
  4. Santiago Pastorino
    Santiago Pastorino
    • Milestone changed from 3.0.5 to 3.0.6

    February 27th, 2011 @ 03:15 AM