0

I am trying to use Globalize3 gem for model translations to Active Record i.e. internationalization for database. After going through the documentation, I was able to implement it successfully on local server in both development and production environment. But when i try to implement it on a production Server, it fails. It shows absurd behavior, i.e. it works and sometime doesn't. Trying to set locale via user input. Using this below function to set locale.

def set_language
    if params[:locale]    
      I18n.default_locale = params[:locale]
    end
    redirect_to :back
  end

link to globalize3 gem documentation

manish nautiyal
  • 2,556
  • 3
  • 27
  • 34

1 Answers1

0

You're only setting the fallback locale with that code. It'll probably help to adjust the current locale, too, as in

def set_language
    if params[:locale]    
      I18n.default_locale = params[:locale]
      I18n.locale = params[:locale]
    end
    redirect_to :back
end
eugen
  • 8,916
  • 11
  • 57
  • 65