Module: R18n
- Defined in:
- lib/r18n-desktop/java.rb,
lib/r18n-desktop.rb,
lib/r18n-desktop/posix.rb,
lib/r18n-desktop/win32.rb
Overview
I18n support for UNIX-like OS.
Copyright © 2008 Andrey “A.I.” Sitnik <[email protected]>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <www.gnu.org/licenses/>.
Defined Under Namespace
Classes: I18n
Class Method Summary collapse
-
.from_env(translations_dir = nil, manual = nil) ⇒ Object
Get user locale from system environment and load I18n object with locale information and translations from
translations_dir
.
Class Method Details
.from_env(translations_dir = nil, manual = nil) ⇒ Object
Get user locale from system environment and load I18n object with locale information and translations from translations_dir
. If user set locale manual
put it as last argument.
40 41 42 43 44 |
# File 'lib/r18n-desktop.rb', line 40 def from_env(translations_dir = nil, manual = nil) locales = Array(R18n::I18n.system_locale) locales.insert(0, manual) if not manual.nil? self.set I18n.new(locales, translations_dir) end |