1 class Locale < I18n::Locale::Tag::Rfc4646
6 super(tags.map { |tag| Locale.tag(tag) })
9 def candidates(preferred)
10 preferred.expand & self
13 def preferred(preferred)
14 candidates(preferred).first
18 map(&:candidates).flatten.uniq << Locale.default
23 List.new(tags.flatten)
27 tag(I18n.default_locale)
31 @available ||= List.new(I18n.available_locales)
35 [self.class.new(language, script, region, variant),
36 self.class.new(language, script, region),
37 self.class.new(language, script, nil, variant),
38 self.class.new(language, script),
39 self.class.new(language, nil, region, variant),
40 self.class.new(language, nil, region),
41 self.class.new(language, nil, nil, variant),
42 self.class.new(language)]