Module: I18n::Gettext

Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/i18n-1.12.0/lib/i18n/gettext.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/i18n-1.12.0/lib/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

Class Method Details

.extract_scope(msgid, separator) ⇒ Object



21
22
23
24
25
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/i18n-1.12.0/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) ⇒ Object

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



17
18
19
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/i18n-1.12.0/lib/i18n/gettext.rb', line 17

def plural_keys(*args)
  args.empty? ? @@plural_keys : @@plural_keys[args.first] || @@plural_keys[:en]
end