module Locale::Info
def get_language(code)
Returns the language for the given 2 or 3 digit code.
def get_language(code) @@lang_three_codes[code] || @@lang_two_codes[code] end
def get_region(code)
Returns the region for the given code.
def get_region(code) @@regions[code] end
def language_code?(code)
Returns the language code is valid.
def language_code?(code) get_language(code) != nil end
def regions
the string is the 2 digit region code from the ISO 3166 data.
Returns a hash of all the ISO regions. The hash is {String, Region} where
def regions @@regions end
def three_languages
all of the data from the ISO 639-3 data (7600 Languages).
the string is the 3 digit language code from the ISO 639 data. This contains
Returns a hash of all the ISO languages. The hash is {String, language} where
def three_languages @@lang_three_codes end
def two_languages
all of the data from the ISO 639-1 data (186 Languages).
the string is the 2 digit language code from the ISO 639-1 data. This contains
Returns a hash of all the ISO languages. The hash is {String, language} where
def two_languages @@lang_two_codes end
def valid_region_code?(code)
Returns the region code is valid.
def valid_region_code?(code) @@regions[code] != nil end