Ruby on Rails Monday, January 31, 2011

I am preparing the upgrade of one RoR aplication that used Rails 2.3.8
and where all the translations worked fine. Now I discovered that it
is not the case any more. Everything seems to work fien except the
Error windows header where the interpolation is not recognized.
I'm using Rails 3.0.3, Ruby 1.9.2.
I've just created a simple application, downloaded the latest french
YML file from I18n github and added a simple validation:
[code]
class Client < ActiveRecord::Base
validates :firstname, :lastname, :presence=> true
end
[/code]
Then I modified the 'application.rb' file as follows:
[code]
config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.
{rb,yml}').to_s]
config.i18n.default_locale = :fr
[/code]
Then I tried to save a Client by leaving the mandatory fields empty
and got:
[code]
"Impossible d'enregistrer ce %{model} : %{count} erreurs"
[/code]
as the header of the Errors dialog window. As you see, the
interpolation was taken as it is instead of putting the Model name and
errors number. The rest of validation message was translated
correctly.
Any idea?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment