Marlor Marlor | 18 Jul 11:10

gettext change language temporarily?


Hello all,

Here is the scenario:

The site is multilingual as expected using gettext and that works fine.
The problem is that when I select a language (E.g German) on the site
and I want to send a semi static EMail (using ActionMailer and gettext)
to another person which has another language (stored in DB).
I am trying to find a way to temporarily set the language to the other
persons language so that his/her email is send in that language. And
after sending set it back to my language.

I have tried several things already like:

[code]
GetText.bindtextdomain('mysite', person.language.name)
tmp = cookies[:lang]
cookies[:lang] = person.language.name
params[:lang] = person.language.name
init_gettext
[/code]

I have tried the above in all possible combinations before sending the
email to the other person but nothing helped.

Any suggestions?

Thanks in advance
--

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane