Fallback to timesince produces erroneous translations in naturaltime
|Reported by:||Owned by:||nobody|
|Severity:||Normal||Keywords:||i18n l10n translation|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The naturaltime filter in
django.contrib.humanize composes strings for days, weeks, months, and years from the words "ago" and "in" and the output of the built-in timesince filter. See here, where
delta is to be supplied by
#: templatetags/humanize.py:190 #, python-format msgctxt "naturaltime" msgid "%(delta)s ago" msgstr "vor %(delta)s"
This produces erroneous translations in German (and probably other inflectional languages, too).
"3 days, 12 hours ago" is translated by Django as
vor 3 Tage, 12 Stunden
but the correct translation is (with dative inflection)
vor 3 Tagen, 12 Stunden
"3 Tage" is correct for
timesince, but for
naturaltime it must become "3 Tagen". Unfortunately, the assumption that these translations can simply be pieced together from translated bits in timesince.py is mistaken.
I apologise if this isn't the right channel. I'd be glad to help, but so far I haven't seen a good way to avoid duplicating translations.