Using Gloc in model

Hi all,

I use Gloc plugin to add multilanguage features to my rails app
the user select the language and I save the value in session[:lang]

in application.rb I have added

before_filter :check_language
def check_language
if session[:lang]== “fr”
set_language :fr
else
set_language :en
end
end

all works great in views and controllers but in models the default
language defined in environment.rb is selected

How can I set the language value in model according to the value stored
in session

I am still newbie with rails !
Thanks for your 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