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.
681841264a2d1bc716fe1cc862276ef3?d=identicon&s=25 Trung Tran (trung)
on 2006-01-16 16: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
9fe908f5593444a40be14a424c372e58?d=identicon&s=25 Masao Mutoh (Guest)
on 2006-01-17 16:06
(Received via mailing list)
Hi,

On Mon, 16 Jan 2006 16:01:36 +0100
Trung Tran <trung_tran@gmx.de> 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.