Multilingual Validation Messages

Hi all,

I have a mutilingual app and want to customize the validation error
messasges. I cannot override them as I need them in more than one
language, so I have done the following:

validates_presence_of :some_attr, :message => _(‘should not be blank’)

I am using gettext to translate the message.

This works in development mode, but not in production, even after a
server restart and the killing of all fcgi processes, i.e. a
completely fresh server. Why is that so and how can I remedy tha
situation?

Many thanks in advance,

  • Nicky

Hi,

On Wed, 8 Mar 2006 16:49:55 +0100
Nickolay K. [email protected] wrote:

This works in development mode, but not in production, even after a
server restart and the killing of all fcgi processes, i.e. a
completely fresh server. Why is that so and how can I remedy tha
situation?

This was a bug of Ruby-GetText-Package.

I misunderstood the difference between development and

production mode.

I’ve fixed it and applied it to CVS just now.

But you will need to call N_() instead of _():

validates_presence_of :some_attr, :message => N_(‘should not be blank’)

Please try CVS version or wait the next release of Ruby-GetText-Pacakge.
#I’ll release it soon.

I’ve fixed it and applied it to CVS just now.

Thanks for the quick reaction. I ended up translating the whole
messages by hand as they were just a few and I needed it pretty
quickly. But it is good to know that it works now.

Thanks again!

– Nicky