]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Explicitly select the default locale if we have no better ideas
[rails.git] / app / controllers / application_controller.rb
index c2f1e644c5f928fd8da86415f5cf0bb6361816c7..e5763876762f7aaa3bc4603610072b623b34c553 100644 (file)
@@ -40,8 +40,6 @@ class ApplicationController < ActionController::Base
     elsif session[:token]
       if @user = User.authenticate(:token => session[:token])
         session[:user] = @user.id
-      else
-        reset_session
       end
     end
   rescue Exception => ex
@@ -249,7 +247,7 @@ class ApplicationController < ActionController::Base
       end
     end
 
-    I18n.locale = request.compatible_language_from(I18n.available_locales)
+    I18n.locale = request.compatible_language_from(I18n.available_locales) || I18n.default_locale
 
     response.headers['Content-Language'] = I18n.locale.to_s
   end