Sha256: 0fd2213d7613dfe013fc81f9cca60b5ee290ecb0a8ee1605c76a44a74be8416a

Contents?: true

Size: 644 Bytes

Versions: 8

Compression:

Stored size: 644 Bytes

Contents

# encoding: utf-8

module I18n
  module Gettext
    PLURAL_SEPARATOR  = "\001"
    CONTEXT_SEPARATOR = "\004"

    @@plural_keys = { :en => [:one, :other] }
    
    class << self
      # 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
      def plural_keys(locale)
        @@plural_keys[locale] || @@plural_keys[:en]
      end

      def extract_scope(msgid, separator = nil)
        scope = msgid.to_s.split(separator || '|')
        msgid = scope.pop
        [scope, msgid]
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
lawrencepit-i18n-0.2.0.1 lib/i18n/gettext.rb
pepe-i18n-0.2.0 lib/i18n/gettext.rb
thedarkone-i18n-0.2.0 lib/i18n/gettext.rb
polish-0.0.5 lib/vendor/i18n/lib/i18n/gettext.rb
polish-0.0.4 lib/vendor/i18n/lib/i18n/gettext.rb
polish-0.0.3 lib/vendor/i18n/lib/i18n/gettext.rb
polish-0.0.2 lib/vendor/i18n/lib/i18n/gettext.rb
polish-0.0.1 lib/vendor/i18n/lib/i18n/gettext.rb