title: spreee-commerce adding second language
body: <p>i need to add support for Spanish in my spree project.
  tried various approaches, the URL way is out for me (not wanted), the globalizer3 doesnt really do what i want. some other extensions dont work, some kill the site, etc.</p>
  
  <p>so i have added </p>
  
  <pre><code>gem 'spree_i18n', :git =&gt; 'git://github.com/spree/spree_i18n.git'
  gem 'globalize3'
  </code></pre>
  
  <p>to my gemfile, while the globalizer willl most likely be scratched (doesnt do what i want).</p>
  
  <p>i have added a "def_lang" column to "spree_users" to store the locale in, which is set by a dropdown box on user signup. available are "en" and "es".</p>
  
  <p>the piece of code and repeated advice i found over the last 14 hours is this:</p>
  
  <p>add the following code to the application_controller.rb (or base_controller.rb according to someone else)</p>
  
  <pre><code>before_filter :set_locale
  
  protected
   def set_locale
   I18n.locale = params[:locale] || I18n.default_locale
  end
  </code></pre>
  
  <p>which i my case should be</p>
  
  <pre><code>before_filter :set_locale
  
   protected #&lt;-this is not in all tips
    def set_locale
    I18n.locale = params[:def_lang] || I18n.default_locale
  end
  </code></pre>
  
  <p>to make it short, it does NOT work.
  the language support for spanish works as can be proven by setting in "application.rb"</p>
  
  <pre><code>config.i18n.default_locale = :es
  </code></pre>
  
  <p>and the site is translated.</p>
  
  <p>why doesnt it work?
  how to make it work?
  is there anything else i can use to get a second language to work on a per-user basis?</p>
  
  <p>please help me out on this.</p>