Skip to content

No plural form for dates with russian translation #8327

Open
@KarelWintersky

Description

@KarelWintersky
  • Gitea version (or commit ref): 1.8.3
  • Database (use [x]): any
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)

Description

Problem with plural forms of dates on russian translation:

  • Обновлено 2 дней назад must be "2 дня"

Same:

  • 1 день
  • 2,3,4 дня
  • 5-20 дней
  • 21 день
  • 22, 23, 24 дня
  • 25 дней

i.e. correct code (PHP, sorry):

return
            ($number % 10 == 1 && $number % 100 != 11)
                ? $forms[0]
                : (
            ($number % 10 >= 2 && $number % 10 <= 4 && ($number % 100 < 10 || $number % 100 >= 20))
                ? $forms[1]
                : $forms[2]
            );

and usage: pluralForm(days, [ 'день', 'дня', 'дней' ]) and so on.

Screenshots

https://try.gitea.io/explore/repos?page=2&sort=recentupdate&q=

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedmodifies/translationtype/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions