Module: I18n::Locale::Tag

Defined in:
lib/i18n/locale/tag.rb,
lib/i18n/locale/tag/simple.rb,
lib/i18n/locale/tag/parents.rb,
lib/i18n/locale/tag/rfc4646.rb

Defined Under Namespace

Modules: Parents Classes: Rfc4646, Simple

Constant Summary

RFC4646_SUBTAGS =
[ :language, :script, :region, :variant, :extension, :privateuse, :grandfathered ]
RFC4646_FORMATS =
{ :language => :downcase, :script => :capitalize, :region => :upcase, :variant => :downcase }

Class Method Summary (collapse)

Class Method Details

+ (Object) implementation

Returns the current locale tag implementation. Defaults to I18n::Locale::Tag::Simple.



12
13
14
# File 'lib/i18n/locale/tag.rb', line 12

def implementation
  @@implementation ||= Simple
end

+ (Object) implementation=(implementation)

Sets the current locale tag implementation. Use this to set a different locale tag implementation.



17
18
19
# File 'lib/i18n/locale/tag.rb', line 17

def implementation=(implementation)
  @@implementation = implementation
end

+ (Object) tag(tag)

Factory method for locale tags. Delegates to the current locale tag implementation.



22
23
24
# File 'lib/i18n/locale/tag.rb', line 22

def tag(tag)
  implementation.tag(tag)
end