%{key} doesn't work with Rails 2.x #277

Closed
justinfrench opened this Issue May 26, 2010 · 14 comments

Projects

None yet

3 participants

@justinfrench
Owner

rails3 branch has corrected a deprecation for {{key}} in translations, but this deprecation appears to only be present in Rails 3.x, not in 2.x, thus the rails3 branch is no longer backwards compatible with Rails 2.x

Needs investigation to find a better path forward, hoping the original contributor can help.

@yabawock
Collaborator

Solution seems rather easy - the deprecation doesn't happen in rails core. The interpolation deprecation is in the I18n gem. This is why no problems showed up in my installation, i did a fresh gemset with the most current I18n gem.

The commit is this: http://github.com/svenfuchs/i18n/commit/8894ee521ef5788c415b625a6daf522af4c416e0

So the upgrade path would be requiring a more recent I18n in the gemspec, i think >= 0.4.0 would be the right point and probably released when formtastic 1.1 goes live

@yabawock
Collaborator

Require i18n >= 0.4.0, this closed by f134673

@mdrozdziel

The problem is still there with i18n = 0.4.1

@yabawock
Collaborator

Have you got some more details regarding your environment? And where does the deprecation occur?

The rails3 branch (which is compatible with rails2 btw) works fine with i18n >= 0.4.0 here and master (which is rails2 only) only supports i18n < 0.4.0 (and has that as a dependency in the gemfile).

@mdrozdziel

http://pastie.org/1064192

% rails -v;ruby -v; gem list formtastic;gem list i18n

Rails 2.3.8
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
formtastic (0.9.10)
i18n (0.4.1)

Easiest temporary fix for me was to disable the warning in i18n, in order to avoid tons of warning messages in logs.

@justinfrench
Owner

Can you please try the latest 1.0.0.x beta of Formtastic with gem install formtastic --pre?

@justinfrench
Owner

Re-opened and tagged with 1.0 for now, just to be sure we nail this.

@yabawock
Collaborator

I checked the 1.0 Gemspec - I thought there's some dependency information in there that enforces I18n < 0.4 but it seems that bit is missing.

@justinfrench
Owner

So, this is all we should need?

    s.add_dependency 'i18n', '< 0.4'

We have this in the spec_helper, which is probably what you're thinking of:

gem 'i18n', '< 0.4'

I've committed this and it'll be in the next beta this weekend. Closing.

@mdrozdziel

Is that the "right" solution? To force people to downgrade other gems?

@justinfrench
Owner

It doesn't force a downgrade. It forces you to have multiple versions installed.

@justinfrench
Owner

For example:

$ gem list i18n
*** LOCAL GEMS ***
i18n (0.4.1, 0.3.7)
@yabawock
Collaborator

@mdrozdziel, it's a deprecation in the I18n gem which forces an update of another software (formtastic) here. Since we have to development tracks at the moment I think it's a sensible approach we are taking.

The 1.0 development track focuses on a stable environment with minimal changes until release. Given your view of the situation we are also forcing you to "downgrade" to rails2 to use formtastic 0.9/1.0.

The rails3 / formtastic 1.1 branch is tracking the current state of gems and is open to a little more invasive changes like the I18n deprecation. Since this branch is backwards compatible with rails2 there's is nothing that hinders you to install it as a plugin or directly check it out from github using bundler.

@mdrozdziel

Well, since different versions of gems can easily coexists, its not really a big issue.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment