Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "rails-i18n" group.
> To post to this group, send email to rails...@googlegroups.com.
> To unsubscribe from this group, send email to rails-i18n+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rails-i18n?hl=en.
>
I looked at by_password.rb at
https://github.com/technoweenie/restful-authentication/blob/master/lib/authentication/by_password.rb
and it does things like
validates_presence_of :password, :if => :password_required?
Do you get the wrong message from those? What message do you get and
what message did you expect instead?
What's the deal with your custom keys like "en.passwordpresent"? Are
you attempting to have Rails use those? If so, how?
There were problems with the following fields
Aha. Probably a Rails gem version issue - try this:
http://www.taylorbrooks.org/error-messages-in-rails-attribute-message/
> The {{attribute}}{{message}} isn't translated. And yes I know to use %{} and
> not {{}} in en.yml. Clearly there is something I am doing wrong but I've
> exhausted my ideas. Last I tried was as follows, which is an excerpt from
> by_password.rb:
> validates_presence_of :password,
> :message=>I18n.t(:passwordpresent), :if => :password_required?
Not relevant anymore, but for good measure: if you use I18n.t in a
class context like that, IIRC it will always use the default locale in
production (since the class isn't reloaded for every request).
Instead, you just specify the symbol (:message => :passwordpresent)
and make sure to put the translation key in the expected place
(somewhere under activerecord.errors I believe).