#11688: verbose_name should allow dynamical translation based on a number
--------------------------------------+------------------------------------
     Reporter:  mitar                 |                    Owner:  nobody
         Type:  New feature           |                   Status:  reopened
    Component:  Internationalization  |                  Version:  1.1
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by lukeplant):

 This suggestion really isn't going to fix it even for Indo-European
 languages, and I think your claim that it does is based entirely on
 wishful thinking. You haven't shown any stats, just "I believe". (I'm not
 blaming you for this - we've already got at least 70 languages in Django,
 and researching all this correctly would be a huge job).

 For example, take the phrase "Delete selected %(verbose_name_plural)s". In
 French, adjectives must agree with the noun, so the translation of the
 word "selected" needs to agree with the gender of whatever word gets
 inserted into the phrase.

 The current Django translation is: "Supprimer les %(verbose_name_plural)s
 sélectionnés". For all feminine model names, this is incorrect - it should
 be: "Supprimer les %(verbose_name_plural)s sélectionnées" (extra e). In
 other places the current French translations have workarounds like
 "%(object)s supprimé(e)s", where "supprimé(e)s" is a bit like doing
 "book(s)".

 Your proposed solution doesn't accommodate this problem, and it is a very
 basic requirement in many European languages, and probably many others.

 We are currently at a 95% solution:

 * Most sentences/phrases don't need substitutions
 * We can cover noun/number agreement using ngettext(). **The original
 ticket was about fixing an instance where we are not doing that, and we
 should definitely try to fix that case.**

 I agree it would be nice to fix the remaining 5%. But we're not going to
 agree to a solution that involves a large amount of work, causes a very
 significant increase in complexity for developers and actually only fixes
 a small (or completely unknown) fraction of the remaining 5%.

 A more generic solution might look something like this:

 For any translatable string we have:

 * A template
 * A substitution (let's assume just 1 for now)

 Then:

 * Any number of properties of the template might cause a different variant
 of the substitution to be used (e.g. if the substitution is a noun, the
 template sentence might put the noun in the accusative/nominative etc.
 position, causing that variant of the noun to be needed)
 * Any number of properties of the substitution might cause a different
 variant of the template to be used. (e.g. if the substitution is a noun
 and has gender, a different sentence is needed that has the right gender
 adjective).

 (The symmetry between template/substitution and the need for more than one
 substitution makes me think this needs to be modelled in a more general
 way, but I'll carry on for now).

 Now, the properties that cause variants are known to the translators, not
 to the template authors. Translators need a way to specify the properties
 and the variants, probably with some kind of pattern matching language for
 selecting the correct variant.

 However:

 1. I don't know if my analysis really covers it — I suspect at the very
 least that combinatorial explosion of properties/variants could make it
 totally impractical.
 2. I really think that we should not be inventing solutions here. It is a
 general problem, there must be general solutions already invented, and we
 should re-use those, or develop them independently of Django.

 Finally, we shouldn't derail this ticket with these concerns. Thanks so
 much for your work in pushing this ticket forward, but let's have another
 ticket to cover issues beyond noun/number agreement.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/11688#comment:12>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to