instance method normalize_pluralization

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

normalize_pluralization(locale, key, value)

No documentation comment.

Parameters

locale req
key req
value req
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/gettext.rb, line 60
        def normalize_pluralization(locale, key, value)
          # FIXME po_parser includes \000 chars that can not be turned into Symbols
          key = key.gsub("\000", I18n::Gettext::PLURAL_SEPARATOR).split(I18n::Gettext::PLURAL_SEPARATOR).first

          keys = I18n::Gettext.plural_keys(locale)
          values = value.split("\000")
          raise "invalid number of plurals: #{values.size}, keys: #{keys.inspect}" if values.size != keys.size

          result = {}
          values.each_with_index { |value, ix| result[keys[ix]] = value }
          [key, result]
        end

Defined in activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/gettext.rb line 60 · View on GitHub · Improve this page · Find usages on GitHub

Defined in I18n::Backend::Gettext

Type at least 2 characters to search.

↑↓ navigate · open · esc close