Explicitly select the default locale if we have no better ideas

This commit is contained in:
Tom Hughes 2011-11-16 09:21:23 +00:00
parent 4408416b62
commit cbd687d0b1

View file

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