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