lib/translations_ennder/rails.rb in translations_ennder-1.1.4 vs lib/translations_ennder/rails.rb in translations_ennder-1.1.5
- old
+ new
@@ -46,9 +46,14 @@
module ActionController
class Base
# Instance methods here
def set_locale
+ #Il faut une session
+ if session[:session_id].blank?
+ return
+ end
+
_param_locale = params[:locale]
if (!_param_locale.blank?) and _param_locale.match /^(en|fr)$/
#Vient du paramètre de requête
I18n.locale = _param_locale
elsif session[:locale].blank? and (! request.env['HTTP_ACCEPT_LANGUAGE'].blank?)