Locale model to store language value not working


I have a problem to store the current locale (language) used by a
user .

I have this model that represent the locale:

class LocaleModel < ActiveRecord::Base
  @@global_locale = nil

  def self.global

  def self.global=( locale )
    if locale.is_a? Locale
      @@global_locale = locale
    elsif locale.is_a? String
      locale = LocaleModel.find(:first, :conditions => ['short = ? ',
      return false if (! locale)
      @@global_locale = locale
      # empty
      @@global_locale = nil

  def master?
    self.master == true

In my application controller I do :

LocaleModel.global = 'fr' if LocaleModel.global == nil

And in some other controller I have an action that is used to change
the locale:

def change_locale
     LocaleModel.global = params[:lang]

The problem is that when I change the view or reload the page, the
locale always resets. How come ?

Thank You