Module Locale
In: lib/locale/base.rb
lib/locale/object.rb
lib/locale/jruby.rb
lib/locale/posix.rb
lib/locale/win32_table.rb
lib/locale/win32.rb
lib/locale/cgi.rb
lib/locale.rb

Locale module manages the locale informations of the application.

Methods

cgi   cgi=   charset   clear   codeset   current   current=   current_charset   default   default=   get   set   set_cgi   set_current   set_default   system   system_module  

Classes and Modules

Module Locale::SystemBase
Module Locale::SystemCGI
Module Locale::SystemJRuby
Module Locale::SystemPosix
Module Locale::SystemWin32
Module Locale::SystemWin32Table
Class Locale::Object

Public Instance methods

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.

Clear default/current locale.

  • Returns: self

Same as charset. Gets the charset of the current locale.

Gets the current locale (Locale::Object).

If the current locale is not set, this returns default locale.

Sets a current locale. This is a single argument version of Locale.set_current.

Same as codeset. Returns the charset of the current locale.

Gets the default locale.

If the default locale not set, this returns system locale.

Same as Locale.set_default.

Notice: lctype is deprecated. Use this with no parameter instead.

Sets a default locale. This function is an alias of Locale.set_default with calling set_current(nil).

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 or String(such as ja_JP.eucJP)).

  • locale: the default locale
  • Returns: self.

Gets the system locale.

Gets the current system module. This is used for debugging.

[Validate]