Locale module manages the locale informations of the application.
- cgi
- cgi=
- charset
- clear
- codeset
- current
- current=
- current_charset
- default
- default=
- default_locale
- default_locale=
- get
- set
- set_cgi
- set_current
- set_default
- set_default_locale
- setlocale
- system
Module Locale::SystemPosix
Module Locale::SystemWin32
Class Locale::Object
CTYPE | = | Locale::System::CTYPE #:nodoc: |
NUMERIC | = | Locale::System::NUMERIC #:nodoc: |
TIME | = | Locale::System::TIME #:nodoc: |
COLLATE | = | Locale::System::COLLATE #:nodoc: |
MONETARY | = | Locale::System::MONETARY #:nodoc: |
MESSAGES | = | Locale::System::MESSAGES #:nodoc: |
ALL | = | Locale::System::ALL #:nodoc: |
CTYPE | = | 0 |
Deprecated. | ||
NUMERIC | = | 1 |
Deprecated. | ||
TIME | = | 2 |
Deprecated. | ||
COLLATE | = | 3 |
Deprecated. | ||
MONETARY | = | 4 |
Deprecated. | ||
MESSAGES | = | 5 |
Deprecated. | ||
ALL | = | 6 |
Deprecated. |
Gets the CGI object. If it is nil, returns new CGI object.
- Returns: the CGI object
Sets a CGI object.
- cgi_: CGI object
- Returns: cgi_
Gets the charset of the current locale.
- Returns: the charset of the current locale (String)
Clear default/current locale.
- Returns: self
Same as charset. Gets the charset of the current locale.
- Returns: the charset of the current locale (String)
Gets the current locale (Locale::Object).
If the current locale is not set, this returns default locale.
- Returns: the current locale (Locale::Object).
Sets a current locale. This is a single argument version of Locale.set_current.
- lang: the Locale::Object
- Returns: the current locale (Locale::Object).
Locale.current = "ja_JP.eucJP" Locale.current = Locale::Object.new("ja", "JP", "eucJP")
Same as codeset. Returns the charset of the current locale.
- Returns: the charset of the current locale (String)
Gets the default locale.
If the default locale not set, this returns system locale.
- Returns: the default locale (Locale::Object).
Same as Locale.set_default.
- locale: the default locale (Locale::Object).
- Returns: locale.
Gets the default Locale::Object.
- Returns: the default locale
Sets a default locale. en.UTF-8 is the default value if not set.
- locale: Locale::Object
- Returns: locale
- Returns: the current locale (Locale::Object).
Notice: lctype is deprecated. Use this with no parameter instead.
- lang: language as String, or Locale::Object
- country: country as String or nil
- charset: charset as String or nil
- Returns: a Locale::Object.
Sets a default locale. This function is an alias of Locale.set_default.
Notice: Locale.set(lctype, locale) is deprecated.
Sets a CGI object.
- cgi_: CGI object
- Returns: self
Sets a locale as the current locale.
This returns the current Locale::Object.
- lang: Locale::Object or locale name(String), or language name.
- country: the country code(String)
- charset: the charset(override the charset even if the locale name has charset).
- Returns: self
Locale.set_current("ja_JP.eucJP") Locale.set_current("ja", "JP") Locale.set_current("ja", "JP", "eucJP") Locale.set_current("ja", nil, "eucJP") Locale.set_current(Locale::Object.new("ja", "JP", "eucJP"))
Sets the default locale (Locale::Object).
- locale: the default locale
- Returns: self.
Sets a default locale. en.UTF-8 is the default value if not set.
- locale: Locale::Object object. You can’t set nil.
- Returns: self
Deprecated. Use Locale.set or Locale.set_current instead.
Gets the system locale.
- Returns: the system locale (Locale::Object).