oops: only infer public locales from language header

This commit is contained in:
Emi Matchu 2013-01-27 00:35:22 -06:00
parent eaf875c6c7
commit 895aef86c2

View file

@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base
return params[:locale] if valid_locale?(params[:locale])
return cookies[:locale] if valid_locale?(cookies[:locale])
Rails.logger.debug "Preferred languages: #{http_accept_language.user_preferred_languages}"
http_accept_language.language_region_compatible_from(I18n.available_locales.map(&:to_s)) ||
http_accept_language.language_region_compatible_from(I18n.public_locales.map(&:to_s)) ||
I18n.default_locale
end