In php I did a solution where I had a language file with different language variables like: if($_SESSION[''lang''] == ''en'') { $start_body = ''Welcome''; } if($_SESSION[''lang''] == ''se'') { $start_body = ''Välkommen''; } This file was included on every page. In the files I used the variable. When the user selected the language that was set in the session, so every variable content reflected the correct language. Where is the best place to store these variables in RoR? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/26/06, Pål Bergström <rails-mailing-list@andreas-s.net> wrote:> > In php I did a solution where I had a language file with different > language variables like: > > if($_SESSION['lang'] == 'en') { > > $start_body = 'Welcome'; > > } > > if($_SESSION['lang'] == 'se') { > > $start_body = 'Välkommen'; > > } > > This file was included on every page. In the files I used the variable. > When the user selected the language that was set in the session, so > every variable content reflected the correct language. > > Where is the best place to store these variables in RoR? >Suggest you use the gettext gem for L10n. Isak> -- > 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Isak Hansen wrote:> On 9/26/06, Pål Bergström <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> if($_SESSION[''lang''] == ''se'') { >> > Suggest you use the gettext gem for L10n. > > > IsakPerfect. Thanks. :-) -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---