Mercurial > babel > old > mirror
comparison babel/messages/catalog.py @ 105:abd3a594dab4
Implement wrapping of header comments in PO(T) output. Related to #14.
author | cmlenz |
---|---|
date | Wed, 13 Jun 2007 21:46:41 +0000 |
parents | b6b5992daa6c |
children | 2a00e352c986 |
comparison
equal
deleted
inserted
replaced
104:57d2f21a1fcc | 105:abd3a594dab4 |
---|---|
225 elif self.locale.language in PLURALS: | 225 elif self.locale.language in PLURALS: |
226 num = PLURALS[self.locale.language][0] | 226 num = PLURALS[self.locale.language][0] |
227 return num | 227 return num |
228 num_plurals = property(num_plurals, doc="""\ | 228 num_plurals = property(num_plurals, doc="""\ |
229 The number of plurals used by the locale. | 229 The number of plurals used by the locale. |
230 | |
231 >>> Catalog(locale='en').num_plurals | |
232 2 | |
233 >>> Catalog(locale='cs_CZ').num_plurals | |
234 3 | |
235 | |
236 :type: `int` | |
230 """) | 237 """) |
231 | 238 |
232 def plural_forms(self): | 239 def plural_forms(self): |
233 num, expr = ('INTEGER', 'EXPRESSION') | 240 num, expr = ('INTEGER', 'EXPRESSION') |
234 if self.locale: | 241 if self.locale: |
238 num, expr = PLURALS[self.locale.language] | 245 num, expr = PLURALS[self.locale.language] |
239 return 'nplurals=%s; plural=%s' % (num, expr) | 246 return 'nplurals=%s; plural=%s' % (num, expr) |
240 plural_forms = property(plural_forms, doc="""\ | 247 plural_forms = property(plural_forms, doc="""\ |
241 Return the plural forms declaration for the locale. | 248 Return the plural forms declaration for the locale. |
242 | 249 |
243 >>> Catalog(locale='en_US').plural_forms | 250 >>> Catalog(locale='en').plural_forms |
244 'nplurals=2; plural=(n != 1)' | 251 'nplurals=2; plural=(n != 1)' |
245 >>> Catalog(locale='pt_BR').plural_forms | 252 >>> Catalog(locale='pt_BR').plural_forms |
246 'nplurals=2; plural=(n > 1)' | 253 'nplurals=2; plural=(n > 1)' |
247 | 254 |
248 :type: `str` | 255 :type: `str` |