]> git.openstreetmap.org Git - rails.git/commitdiff
Discard and locale tags that fail to parse
authorTom Hughes <tom@compton.nu>
Thu, 7 Jan 2016 09:10:19 +0000 (09:10 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 7 Jan 2016 09:10:19 +0000 (09:10 +0000)
lib/locale.rb

index bb09ae327121361f7c782bcb778e28220b70e91d..e10f066329a0fd4e126d1416c55271f86fbc564b 100644 (file)
@@ -3,7 +3,7 @@ class Locale < I18n::Locale::Tag::Rfc4646
     attr_reader :locales
 
     def initialize(tags)
-      super(tags.map { |tag| Locale.tag(tag) })
+      super(tags.map { |tag| Locale.tag(tag) }).compact!
     end
 
     def candidates(preferred)