Globalize language changing


I have installed the Globalize plug in, and, for what I can see, am
using it as suggested on the wiki. In my application.rb file i have
the following:

include Globalize
Locale.set_base_language ‘en-CA’
Locale.set ‘en-CA’

and on each page i have a link to switch the language to french, or
back to enlish.:

<% if Locale.language_code == ‘en’ %>
<%= link_to “Français”, { :action => ‘fr’ }, { :class =>
‘toplinks’ } %>
<% else %>
<%= link_to “English”, { :action => ‘en’ }, { :class => ‘toplinks’ }
<% end %>

and in the controller:

def fr
Locale.set ‘fr-CA’
render :action => ‘index’

def en
Locale.set ‘en-CA’
render :action => ‘index’

This works just fine if only on person is on the site, but, if I change
my language to french, and then have someone else go to the page, their
language is changed to french.

This is currently running on a single instance of mongle.

Am i going about this wrong?

Thanks for the help!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs