File: active_support/vendor/i18n-0.4.1/i18n/gettext.rb

Overview
Module Structure
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: I18n#3
  module: Gettext#4
has properties
constant: PLURAL_SEPARATOR #5
constant: CONTEXT_SEPARATOR #6
module method: plural_keys / 1 #16
module method: extract_scope / 2 #20

Code

   1  # encoding: utf-8
   2 
   3  module I18n
   4    module Gettext
   5      PLURAL_SEPARATOR  = "\001"
   6      CONTEXT_SEPARATOR = "\004"
   7 
   8      autoload :Helpers, 'i18n/gettext/helpers'
   9 
  10      @@plural_keys = { :en => [:one, :other] }
  11 
  12      class << self
  13        # returns an array of plural keys for the given locale so that we can
  14        # convert from gettext's integer-index based style
  15        # TODO move this information to the pluralization module
  16        def plural_keys(locale)
  17          @@plural_keys[locale] || @@plural_keys[:en]
  18        end
  19 
  20        def extract_scope(msgid, separator)
  21          scope = msgid.to_s.split(separator)
  22          msgid = scope.pop
  23          [scope, msgid]
  24        end
  25      end
  26    end
  27  end