| Class | Locale::Object |
| In: |
lib/locale/object.rb
|
| Parent: | Object |
| charset | [R] | |
| country | [R] | |
| fallback | [RW] | A fallback locale. With GetText, you don‘t need to set English(en,C,POSIX) by yourself because English is used as the last fallback locale anytime. |
| language | [R] | |
| modifier | [R] | |
| orig_str | [R] | |
| script | [R] | |
| variant | [R] |
Initialize Locale::Object.
Locale::Object.new("ja", "JP", "eucJP")
-> language = "ja", country = "JP", charset = "eucJP".
Locale::Object.new("ja", "JP")
-> language = "ja", country = "JP", charset = nil.
Locale::Object.new("ja_JP.eucJP")
-> language = "ja", country = "JP", charset = "eucJP".
Locale::Object.new("ja_JP.eucJP", nil, "UTF-8")
-> language = "ja", country = "JP", charset = "UTF-8".
Locale::Object.new("en-US", "CA")
-> language = "en", country = "CA", charset = nil.
Locale::Object.new("uz-uz-latn")
-> language = "uz", country = "UZ", charset = nil, script = "Latn"
Locale::Object.new("uz_UZ_Latn")
-> language = "uz", country = "UZ", charset = nil, script = "Latn"
Locale::Object.new("we_BE.iso885915@euro")
-> language = "we", country = "BE", charset = "iso885915", modifier = "euroo".
Locale::Object.new("C")
-> language = "en", country = nil, charset = nil.
Locale::Object.new("POSIX")
-> language = "en", country = nil, charset = nil.
Parse POSIX or RFC 3066 style locale name to Array.
(e.g.) uz-UZ-Latn, ja_JP.eucJP, wa_BE.iso885915@euro
(e.g.) "ja_JP.eucJP" => ["ja", "JP", "eucJP", nil, nil] "ja-jp.utf-8" => ["ja", "JP", "utf-8", nil, nil] "ja-jp" => ["ja", "JP", nil, nil, nil] "ja" => ["ja", nil, nil, nil, nil] "uz@Latn" => ["uz", nil, nil, nil, "Latn"] "uz-UZ-Latn" => ["uz", "UZ", nil, "Latn", nil] "uz_UZ_Latn" => ["uz", "UZ", nil, "Latn", nil] "wa_BE.iso885915@euro" => ["wa", "BE", "iso885915", nil, "euro"] "C" => ["en", nil, nil, nil, nil] "POSIX" => ["en", nil, nil, nil, nil] "zh_Hant" => ["zh", nil, nil, "Hant", nil] "zh_Hant_HK" => ["zh", "HK", nil, "Hant", nil] "de_DE@collation=phonebook,currency=DDM" => ["de", "DE", nil, nil, "collation=phonebook,currency=DDM"]
Gets the locale informations as an Array.