MailingList


Flash ?

View: New views
3 Messages — Rating Filter:   Alert me  

Flash ?

by Peter Schrammel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I'm actually thinking about i18n-ing a plugin and wonder if there is a
solution for translating flash[..] messages?

I'd simply override some methods of the ActionController::Flash class
([]=, now). Has anybody already done this? Better solutions? Caveats?

I'm still using rails 1.2.6, so the solutions should work for 1.2.6 and 2.x.

Regards
Peter


Re: Flash ?

by Sprachprofi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

if you use LanguageFu (not sure about Globalize), you can use the .t
function in controllers and models as well, so what I'd suggest is
doing
flash[:notice] = "You have successfully logged out".t  .

Best wishes,

Judith



On Fri, Aug 1, 2008 at 9:54 PM, Peter Schrammel <peter.schrammel@...> wrote:

> Hi
>
> I'm actually thinking about i18n-ing a plugin and wonder if there is a
> solution for translating flash[..] messages?
>
> I'd simply override some methods of the ActionController::Flash class
> ([]=, now). Has anybody already done this? Better solutions? Caveats?
>
> I'm still using rails 1.2.6, so the solutions should work for 1.2.6 and 2.x.
>
> Regards
> Peter
>
>

Re: Flash ?

by Peter Schrammel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Judith Meyer schrieb:
> Hi,
>
> if you use LanguageFu (not sure about Globalize), you can use the .t
> function in controllers and models as well, so what I'd suggest is
> doing
> flash[:notice] = "You have successfully logged out".t  .
>
Yes thats what I'd do if I'd be sure that everyone uses globalize with
the plugin. But there are still un-i18n-ed apps so I'm looking for a
solution to be able to do i18n but in a transparent way. So I don't want
to touch the plugin but touch the app/rails.

Thanks so far

Peter