module FastGettext
Modifications wrapped inside FastGettext
namespace to reduce conflic
Provides Iconv.iconv
which normally is provided through Ruby/GLib(1) functions. This library is required for ‘gettext’. If you require ‘gettext/iconv’, it tries to call Ruby/GLib function when it doesn’t find original Iconv
class(iconv.so) it adds a pseudo class.
One-click Ruby Installer for Win32 hadn’t had iconv and there hadn’t been a way to install iconv.so itself for Win32. And JRuby hadn’t had Iconv
. I’ve not checked them currently, but if they’ve supported iconv now, we don’t need this anymore…
(1) Ruby/GLib is a module which is provided from Ruby-GNOME2 Project. You can get binaries for Win32(One-Click Ruby Installer). <URL: ruby-gnome2.sourceforge.jp/>
Constants
- CONTEXT_SEPARATOR
- Iconv
- LOCALE_REX
- NAMESPACE_SEPARATOR
- NIL_BLOCK
- TRANSLATION_METHODS
- VERSION
Public Class Methods
# File lib/fast_gettext.rb, line 27 def self.add_text_domain(name, options) translation_repositories[name] = TranslationRepository.build(name, options) end
some repositories know where to store their locales
# File lib/fast_gettext.rb, line 32 def self.locale_path translation_repositories[text_domain].instance_variable_get(:@options)[:path] end
helper block for changing domains
# File lib/fast_gettext.rb, line 19 def self.with_domain(domain) old_domain = FastGettext.text_domain FastGettext.text_domain = domain yield ensure FastGettext.text_domain = old_domain end