fix failing tests

This commit is contained in:
Reinier Balt 2010-11-09 10:47:09 +01:00
parent fd3f69d927
commit 6b36d6eb8f
8 changed files with 17 additions and 11 deletions

View file

@ -50,7 +50,8 @@ class ApplicationController < ActionController::Base
end
def set_locale
locale = params[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first
locale = params[:locale]
locale = locale || request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE']
I18n.locale = I18n::available_locales.include?(locale) ? locale : I18n.default_locale
logger.debug("Selected '#{I18n.locale}' as locale")
end