Explicitly select the default locale if we have no better ideas
authorTom Hughes <tom@compton.nu>
Wed, 16 Nov 2011 09:21:23 +0000 (09:21 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 16 Nov 2011 09:21:23 +0000 (09:21 +0000)
app/controllers/application_controller.rb

index 0412080fa3a9109faf02dc2e27fe7b0fc297332d..e5763876762f7aaa3bc4603610072b623b34c553 100644 (file)
@@ -247,9 +247,7 @@ class ApplicationController < ActionController::Base
       end
     end
 
-    I18n.locale = request.compatible_language_from(I18n.available_locales)
-
-    logger.info "Selected locale #{I18n.locale} from #{request.user_preferred_languages.inspect}"
+    I18n.locale = request.compatible_language_from(I18n.available_locales) || I18n.default_locale
 
     response.headers['Content-Language'] = I18n.locale.to_s
   end