Method: WorldFlags::Helper::Locale#extract_locale_from_tld

Defined in:
lib/world_flags/helper/locale.rb

#extract_locale_from_tldObject

Get locale from top-level domain or return nil if such locale is not available You have to put something like:

127.0.0.1 application.com
127.0.0.1 application.it
127.0.0.1 application.pl

in your /etc/hosts file to try this out locally



64
65
66
# File 'lib/world_flags/helper/locale.rb', line 64

def extract_locale_from_tld
  I18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale  : nil
end