#32797: model_ngettext incorrectly tries to translate already translated words
-------------------------------------+-------------------------------------
     Reporter:  Maciej Olko          |                    Owner:  (none)
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  3.2
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  i18n, gettext,       |             Triage Stage:
  ngettext                           |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 Hi Maciej.

 No doubt my lack of knowledge of the internals of the i18n, but I'm
 struggling to pin this.

 Using French as the active language for an example:

 1. Create multiple users (who have a lazy
 `verbose_name`/`verbose_name_plural` defined).
 2. Use the delete selected action from the changelist (triggering the
 `model_ngettext()` flow)
 3. Observe correct translation.

 [[Image(https://code.djangoproject.com/raw-
 attachment/ticket/32797/Screenshot%202021-06-08%20at%2010.23.33.png)]]

 It's at that level (which is the public API) that it would be good if you
 can present a failing test.

 > Effectively it makes Django not use correct plural translations for
 verbose name for any language that has other plural rules then English for
 phrases

 So I'm guessing French is not the right example language?

 Is this a duplicate of #11688?

 From the PR, adding the `ngettext_noop('log entry', 'log entries')`
 function call into `Meta` declarations doesn't look like the right
 approach. If `model_ngettext` does need extra logic to detect these cases,
 we should keep that logic internal to the function. (I'll close the
 current PR on that basis.)

 I'm going to mark as needs info, but happy to discuss further if you can
 help pin it down, perhaps with that test case?

 Thanks!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32797#comment:3>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d1e0c456132ed9d6eae11e2ec3518dd3%40djangoproject.com.

Reply via email to