lib/world_flags/helper/locale.rb in world-flags-0.4.1 vs lib/world_flags/helper/locale.rb in world-flags-0.4.2
- old
+ new
@@ -13,10 +13,10 @@
end
end
# ensure all country/language/domain types are mapped to their equivalent locale code
def locales
- locale_sources.downcase.map {|loc| WorldFlags.locale(loc) }
+ locale_sources.compact.downcase.map {|loc| WorldFlags.locale(loc) unless loc.blank? }
end
def locale_sources
[params[:locale], extract_locale_from_tld, browser_locale, ip_country_code, I18n.default_locale]
end
\ No newline at end of file