From: Tom Hughes Date: Thu, 7 Jan 2016 09:10:19 +0000 (+0000) Subject: Discard and locale tags that fail to parse X-Git-Tag: live~3993 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/213fa728ea206d6f27fb22523e2c227564831209 Discard and locale tags that fail to parse --- diff --git a/lib/locale.rb b/lib/locale.rb index bb09ae327..e10f06632 100644 --- a/lib/locale.rb +++ b/lib/locale.rb @@ -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)