Module: I18n::Locale::Tag
- Defined in:
- lib/vendor/i18n/lib/i18n/locale/tag.rb,
lib/vendor/i18n/lib/i18n/locale/tag/simple.rb,
lib/vendor/i18n/lib/i18n/locale/tag/parents.rb,
lib/vendor/i18n/lib/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
-
.implementation ⇒ Object
Returns the current locale tag implementation.
-
.implementation=(implementation) ⇒ Object
Sets the current locale tag implementation.
-
.tag(tag) ⇒ Object
Factory method for locale tags.
Class Method Details
.implementation ⇒ Object
Returns the current locale tag implementation. Defaults to I18n::Locale::Tag::Simple
.
11 12 13 |
# File 'lib/vendor/i18n/lib/i18n/locale/tag.rb', line 11 def implementation @@implementation ||= Simple end |
.implementation=(implementation) ⇒ Object
Sets the current locale tag implementation. Use this to set a different locale tag implementation.
16 17 18 |
# File 'lib/vendor/i18n/lib/i18n/locale/tag.rb', line 16 def implementation=(implementation) @@implementation = implementation end |
.tag(tag) ⇒ Object
Factory method for locale tags. Delegates to the current locale tag implementation.
21 22 23 |
# File 'lib/vendor/i18n/lib/i18n/locale/tag.rb', line 21 def tag(tag) implementation.tag(tag) end |