Forum: Ruby on Rails GetText (change default error messages)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Trung T. (Guest)
on 2006-01-16 17:01
Hi,

is it possible to change the default error messages?

for example from

... errors prohibited this ... from being saved

to something else?

thanks,
trung
Masao M. (Guest)
on 2006-01-17 17:06
(Received via mailing list)
Hi,

On Mon, 16 Jan 2006 16:01:36 +0100
Trung T. <removed_email_address@domain.invalid> wrote:

> Hi,
>
> is it possible to change the default error messages?

You can change vaildation messages like as:

class Foo < ActiveRecord::Base
  validates_presence_of :title, :message => _("%{fn} can't be empty")
  validates_length_of :description, :minimum => 10,
                :message => _("%{fn} is too short (min is %d
characters)")
end

#They called default_error_messages in actionpack.

> for example from
>
> ... errors prohibited this ... from being saved
>
> to something else?

But you can't change these messages now(of course it's translated,
though).
This behavior follows actionpack-1.11.2.

But I like your idea.
I'll implement your idea to next version of Ruby-GetText-Package.
This topic is locked and can not be replied to.