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