Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
mcdonc opened this Issue · 0 comments

1 participant

@mcdonc
Owner

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'
@mcdonc mcdonc closed this issue from a commit
@mcdonc mcdonc - 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
@mcdonc mcdonc closed this in 5b5cd6f
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.