Module: Locale::Tag

### Home Classes Methods

### In Files

- lib/locale/tag.rb
- lib/locale/tag/cldr.rb
- lib/locale/tag/posix.rb
- lib/locale/tag/common.rb
- lib/locale/tag/simple.rb
- lib/locale/tag/irregular.rb
- lib/locale/tag/rfc.rb

### Namespace

- CLASS Locale::Tag::Cldr
- CLASS Locale::Tag::Common
- CLASS Locale::Tag::Irregular
- CLASS Locale::Tag::Posix
- CLASS Locale::Tag::Rfc
- CLASS Locale::Tag::Simple

### Methods

- #parse

### Class/Module Index

Quicksearch

- Locale
- Locale::Driver
- Locale::Driver::CGI
- Locale::Driver::Env
- Locale::Driver::Env::Private
- Locale::Driver::JRuby
- Locale::Driver::Posix
- Locale::Driver::Win32
- Locale::Driver::Win32::Kernel32
- Locale::Driver::Win32Table
- Locale::Info
- Locale::Info::Language
- Locale::Info::Region
- Locale::Middleware
- Locale::Tag
- Locale::Tag::Cldr
- Locale::Tag::Common
- Locale::Tag::Irregular
- Locale::Tag::Posix
- Locale::Tag::Rfc
- Locale::Tag::Simple
- Locale::TagList

No matching classes.

# Locale::Tag

Language tag / locale identifiers.

### Public Instance Methods

parse(tag) click to toggle source

Parse a language tag/locale name and return Locale::Tag object.

- tag: a tag as a String. e.g.) ja-Hira-JP

- Returns: a Locale::Tag subclass.

    # File lib/locale/tag.rb, line 26
    def parse(tag)
      # Common is not used here.
      [Simple, Common, Rfc, Cldr, Posix].each do |parser|
        ret = parser.parse(tag)
        return ret if ret
      end
      Locale::Tag::Irregular.new(tag)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.