Yes, i use it a lot, but in this form:
record.errors.add attr, :invalid # or any other
And then in the config/locales/es.yml
es:
activerecord:
errors:
messages:
invalid: "no es válido"
# Custom for one model
models:
somemoder:
attributes:
someattribute:
invalid: "es inválido"
I never use it in the direct form, always with the I18n package. If
you want a complete example see
http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale.
Regards.
Franco Catena.
On May 26, 5:00 pm, tivrfoa <[email protected]> wrote:
> thansk Franco.
>
> it works on the view, but not work in the model (at least here)
> did you try to add a message in some model with accent?
>
> On May 26, 2:43 pm, Franco Catena <[email protected]> wrote:
>
> > I create almost only spanish applications, all with Ñ ñ, á é and so
> > on, and use ONLY UTF-8.
>
> > The meta directive <meta http-equiv="Content-Type" content="text/html;
> > charset=utf-8" /> between the head tags does all the magic.
>
> > Regards.
>
> > Franco Catena.
>
> > On May 26, 12:19 pm,tivrfoa<[email protected]> wrote:
>
> > > tks! it didn't work in utf-8. if I use está (without the special
> > > character), it display an interrogation symbol (?)
>
> > > Could someone try to use this => :message => 'está incorreto'
> > > in some validation to see if it works?
>
> > > How can I display "está"?
>
> > > tks
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---