module I18n::Gettext

Constants

CONTEXT_SEPARATOR
PLURAL_SEPARATOR

Public Class Methods

extract_scope(msgid, separator) click to toggle source
# File lib/i18n/gettext.rb, line 21
def extract_scope(msgid, separator)
  scope = msgid.to_s.split(separator)
  msgid = scope.pop
  [scope, msgid]
end
plural_keys(*args) click to toggle source

returns an array of plural keys for the given locale or the whole hash of locale mappings to plural keys so that we can convert from gettext's integer-index based style TODO move this information to the pluralization module

# File lib/i18n/gettext.rb, line 17
def plural_keys(*args)
  args.empty? ? @@plural_keys : @@plural_keys[args.first] || @@plural_keys[:en]
end