Skip to content
This repository

When no mo files exist for a domain, pluralizer raises inscrutable error #235

Closed
mcdonc opened this Issue July 14, 2011 · 0 comments

1 participant

Chris McDonough
Chris McDonough
Owner
mcdonc commented July 14, 2011

This sort of error will be raised when no mofile for a given domain exists, and someone attempts a pluralization against that domain:

Traceback (most recent call last):
  File "/home/chrism/projects/pyramid/pyramid/tests/test_i18n.py", line 487, in test_default_germanic_pluralization
    result = t.dungettext('messages', 'foo1', 'foos1', 2)
  File "/home/chrism/projects/pyramid/pyramid/i18n.py", line 337, in dungettext
    return self._domains.get(domain, self).ungettext(singular, plural, num)
  File "/home/chrism/opt/Python-2.6.5/lib/python2.6/gettext.py", line 409, in ungettext
    tmsg = self._catalog[(msgid1, self.plural(n))]
AttributeError: 'Translations' object has no attribute 'plural'
Chris McDonough mcdonc closed this issue from a commit July 14, 2011
Chris McDonough - Without a mo-file loaded for the combination of domain/locale,
  ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale
  combination raised an inscrutable "translations object has no attr 'plural'
  error.  Now, instead it "works" (it uses a germanic pluralization by
  default).  This is not the "right" thing really (it's nonsensical to try to
  pluralize something without translations for that locale/domain available),
  but it matches the behavior of ``pyramid.i18n.Localizer.translate`` so it's
  at least consistent; see #235.

Closes #235.
5b5cd6f
Chris McDonough mcdonc closed this in 5b5cd6f July 14, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.