#29825: ngettext returns invalid result if msgstr is also a valid msgid in the 
same
catalog
-------------------------------------+-------------------------------------
     Reporter:  Jeremy Moffitt       |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:                       |                  Version:  2.1
  Internationalization               |
     Severity:  Normal               |               Resolution:
     Keywords:  ngettext             |             Triage Stage:  Accepted
  localization                       |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Jeremy Moffitt):

 The following passes the unit test, but I'm not clear if it will have
 other repercussions I'm overlooking:


 {{{
 diff --git a/django/views/i18n.py b/django/views/i18n.py
 index e121d3038a..82978dace2 100644
 --- a/django/views/i18n.py
 +++ b/django/views/i18n.py
 @@ -114,6 +114,8 @@ js_catalog_template = r"""
        var value = django.catalog[singular];
        if (typeof(value) == 'undefined') {
          return (count == 1) ? singular : plural;
 +      } if (typeof(count) == 'undefined') {
 +        return singular;
        } else {
          return value[django.pluralidx(count)];
        }

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29825#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.e9f5e44c30cb1727999ed62c928cc5f8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to