Module: I18n::Locale::Tag

Defined in:
lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb,
lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb,
lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/parents.rb,
lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/rfc4646.rb

Defined Under Namespace

Modules: Parents Classes: Rfc4646, Simple

Constant Summary collapse

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

.implementationObject

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



12
13
14
# File 'lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb', line 12

def implementation
  @@implementation ||= Simple
end

.implementation=(implementation) ⇒ Object

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



17
18
19
# File 'lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb', line 17

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

.tag(tag) ⇒ Object

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



22
23
24
# File 'lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb', line 22

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