Module: I18n::Gettext
- Defined in:
- lib/active_support/vendor/i18n-0.4.1/i18n/gettext.rb,
lib/active_support/vendor/i18n-0.4.1/i18n/gettext/helpers.rb
Defined Under Namespace
Modules: Helpers
Constant Summary collapse
- PLURAL_SEPARATOR =
"\001"
- CONTEXT_SEPARATOR =
"\004"
- @@plural_keys =
{ :en => [:one, :other] }
Class Method Summary collapse
- .extract_scope(msgid, separator) ⇒ Object
-
.plural_keys(locale) ⇒ Object
returns an array of plural keys for the given locale so that we can convert from gettext’s integer-index based style TODO move this information to the pluralization module.
Class Method Details
.extract_scope(msgid, separator) ⇒ Object
20 21 22 23 24 |
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/gettext.rb', line 20 def extract_scope(msgid, separator) scope = msgid.to_s.split(separator) msgid = scope.pop [scope, msgid] end |
.plural_keys(locale) ⇒ Object
returns an array of plural keys for the given locale so that we can convert from gettext’s integer-index based style TODO move this information to the pluralization module
16 17 18 |
# File 'lib/active_support/vendor/i18n-0.4.1/i18n/gettext.rb', line 16 def plural_keys(locale) @@plural_keys[locale] || @@plural_keys[:en] end |