module Locale::Info
Public Instance Methods
Source
# File lib/locale/info/language.rb, line 128 def get_language(code) @@lang_three_codes[code] || @@lang_two_codes[code] end
Returns the language for the given 2 or 3 digit code.
Need to require ‘locale/info’ or ‘locale/language’.
Source
# File lib/locale/info/region.rb, line 64 def get_region(code) @@regions[code] end
Returns the region for the given code.
You need to require ‘locale/info’ or ‘locale/info/region’.
Source
# File lib/locale/info/language.rb, line 135 def language_code?(code) get_language(code) != nil end
Returns the language code is valid.
Need to require ‘locale/info’ or ‘locale/language’.
Source
# File lib/locale/info/region.rb, line 57 def regions @@regions end
Returns a hash of all the ISO regions. The hash is {String, Region} where the string is the 2 digit region code from the ISO 3166 data.
You need to require ‘locale/info’ or ‘locale/region’.
Source
# File lib/locale/info/language.rb, line 112 def three_languages @@lang_three_codes end
Returns a hash of all the ISO languages. The hash is {String, language} where the string is the 3 digit language code from the ISO 639 data. This contains all of the data from the ISO 639-3 data (7600 Languages).
Need to require ‘locale/info’ or ‘locale/language’.
Source
# File lib/locale/info/language.rb, line 121 def two_languages @@lang_two_codes end
Returns a hash of all the ISO languages. The hash is {String, language} where the string is the 2 digit language code from the ISO 639-1 data. This contains all of the data from the ISO 639-1 data (186 Languages).
Need to require ‘locale/info’ or ‘locale/language’.
Source
# File lib/locale/info/region.rb, line 71 def valid_region_code?(code) @@regions[code] != nil end
Returns the region code is valid.
You need to require ‘locale/info’ or ‘locale/info/region’.