lib/world_flags/helper/locale.rb in world-flags-0.4.5 vs lib/world_flags/helper/locale.rb in world-flags-0.4.7
- old
+ new
@@ -33,13 +33,17 @@
when :domain
extract_locale_from_tld # http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
when :browser
browser_locale # http://www.metamodpro.com/browser-language-codes
when :ip
- ip_country_code
+ ip_country_code(browser_ip)
when :default
I18n.default_locale
end
+ end
+
+ def browser_ip
+ request.remote_ip
end
def locale_source_priority
WorldFlags.locale_source_priority
end
\ No newline at end of file