enable localhost:3000 in 18n set_locale(host)

This commit is contained in:
Dylan Peerenboom 2014-09-12 09:51:21 -07:00
parent 8bbd369f7a
commit a9c1f9a02a

View File

@ -139,7 +139,7 @@ module I18n
if lang === false
lang = nil
elsif lang.nil?
if (lang = host.gsub(/^(dev|test|www)[\-\.](.*)$/, '\2').gsub(/^(([^\.]+)\.)?[^\.]+\.[^\.]+$/, '\2')).blank?
if (lang = host.gsub(/^(dev|test|www)[\-\.](.*)$/, '\2').gsub(/^(([^\.]+)\.)?[^\.]+\.[^\.]+$/, '\2')).blank? || (host == "localhost")
lang = default
end
if get_language_codes().include? lang