Opened 10 years ago

Closed 10 years ago

#23619 closed Bug (invalid)

Russian humanize does not correctly handle paucal numbers in naturaltime filter

Reported by: Kirill Gagarski Owned by: nobody
Component: Translations Version: 1.7
Severity: Normal Keywords: humanize russian
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello.
I have detected some problems when I tried to use 'naturaltime' filter with russian i18n.

For example:

  • "2 hours ago" is translated as "2 часа назад" (which is correct, so I suppose django can handle such cases).

But:

  • "5 days, 2 hours ago" is translated as "5 дней, 2 часов назад" instead of "5 дней, 2 часа назад" (notice the incorrect ending of russian "hours" word and the correct one in the previous case).

Also there are problems with "days" word:

  • "2 days ago", "3 days ago" and "4 days ago" are translated as "2 дней назад", "3 дней назад" and "4 дней назад". The correct translation is "2 дня назад", "3 дня назад" and "4 дня назад".

Summary:

  • Paucal endings are handled correctly with "hours" word when there is no "days" component in 'naturaltime' filter result.
  • Paucal endings are always handled correctly with words "minites" and "seconds" (probably because phrases with minutes or seconds never have the second component)
  • Paucal endings are never handled correctly with words "days", "months" and "years". I even cannot find strings for them in django/contrib/humanize/locale/ru/django.po file (are they handled by other declension mechanism?)

Change History (1)

comment:1 by Claude Paroz, 10 years ago

Component: InternationalizationTranslations
Resolution: invalid
Status: newclosed
Type: UncategorizedBug

The problem is indeed in the Russian translation. Some of those translations are from django.contrib.humanize (apparently the correct ones). But when the difference is greater than one day, naturaltime is calling django.utils.timesince and this time the translation comes from the Django core po file.

From humanize translations:

msgid "an hour ago"
msgid_plural "%(count)s hours ago"
msgstr[0] "%(count)s час назад"
msgstr[1] "%(count)s часа назад"
msgstr[2] "%(count)s часов назад"

From Django core translations:

msgid "%d hour"
msgid_plural "%d hours"
msgstr[0] "%d час"
msgstr[1] "%d часов"
msgstr[2] "%d часов"

Translations issues are not tracked here, but should be fixed directly in Transifex, hence the invalid closing.
https://docs.djangoproject.com/en/dev/internals/contributing/localizing/#translations

Note: See TracTickets for help on using tickets.
Back to Top