Browse Source

enable localhost:3000 in 18n set_locale(host)

development
Dylan Peerenboom 10 years ago
parent
commit
a9c1f9a02a
  1. 2
      config/initializers/i18n.rb

2
config/initializers/i18n.rb

@ -139,7 +139,7 @@ module I18n
if lang === false if lang === false
lang = nil lang = nil
elsif 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 lang = default
end end
if get_language_codes().include? lang if get_language_codes().include? lang

Loading…
Cancel
Save