Edgewall Software

Ticket #423: i18n.patch

File i18n.patch, 1.2 KB (added by antti@…, 12 years ago)

fix for garbage strings problem...

  • Genshi-0.6/genshi/filters/i18n.py

    y x  
    375375        plural_msgbuf = None
    376376
    377377        numeral = self.numeral.evaluate(ctxt)
    378         is_plural = self._is_plural(numeral, ngettext)
     378        is_plural = self._is_plural(numeral)
    379379
    380380        for event in stream:
    381381            if event[0] is SUB and any(isinstance(d, ChooseBranchDirective)
     
    478478            (singular_msgbuf.format(), plural_msgbuf.format()), \
    479479            comment_stack[-1:]
    480480
    481     def _is_plural(self, numeral, ngettext):
    482         # XXX: should we test which form was chosen like this!?!?!?
    483         # There should be no match in any catalogue for these singular and
    484         # plural test strings
    485         singular = u'O\x85\xbe\xa9\xa8az\xc3?\xe6\xa1\x02n\x84\x93'
    486         plural = u'\xcc\xfb+\xd3Pn\x9d\tT\xec\x1d\xda\x1a\x88\x00'
    487         return ngettext(singular, plural, numeral) == plural
    488 
     481    def _is_plural(self, numeral):
     482        return numeral != 1
    489483
    490484class DomainDirective(I18NDirective):
    491485    """Implementation of the ``i18n:domain`` directive which allows choosing