Module: Locale::SystemPosix
- Extended by:
- System
- Defined in:
- lib/gettext/locale_posix.rb
Overview
Locale::SystemPosix module for Posix OS (Unix) This is low-level class. Application shouldn’t use this directly.
Constant Summary
Constants included from System
Locale::System::ALL, Locale::System::COLLATE, Locale::System::CTYPE, Locale::System::MESSAGES, Locale::System::MONETARY, Locale::System::NUMERIC, Locale::System::TIME
Class Method Summary collapse
-
.get_charset(locale) ⇒ Object
Gets the charset of the locale.
-
.system ⇒ Object
Gets the system locale using setlocale and nl_langinfo.
Methods included from System
Class Method Details
.get_charset(locale) ⇒ Object
Gets the charset of the locale.
-
locale: Locale::Object
-
Returns: the charset of the locale
31 32 33 34 35 36 37 |
# File 'lib/gettext/locale_posix.rb', line 31 def get_charset(locale) old = set(Locale::System::CTYPE, nil) set(Locale::System::CTYPE, locale.orig_str) ret = codeset set(Locale::System::CTYPE, old) ret end |
.system ⇒ Object
Gets the system locale using setlocale and nl_langinfo.
-
Returns the system locale (Locale::Object).
21 22 23 24 25 26 |
# File 'lib/gettext/locale_posix.rb', line 21 def system old = set(Locale::System::CTYPE, nil) locale = Locale::Object.new(set(Locale::System::CTYPE, ""), nil, codeset) set(Locale::System::CTYPE, old) locale end |