Opened 3 years ago
Closed 3 years ago
#33661 closed Bug (fixed)
Fix Catalan formats.py to use alt.month
Reported by: | mpachas | Owned by: | mpachas |
---|---|---|---|
Component: | Internationalization | Version: | 4.0 |
Severity: | Normal | Keywords: | date, template, i18n |
Cc: | Carlton Gibson | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
DATE_FORMAT, DATETIME_FORMAT and MONTH_DAY_FORMAT strings in Catalan language are wrong because it uses always the preposition "de" between the day number and the month name but it is wrong when the month name starts with vowel like abril (April), agost (August) or octubre (October). In that case it should be d'abril, d'agost or d'octubre.
I think that alt.month Month translations were created to help in this kind of situations (https://github.com/django/django/commit/2478f8588e) so this issue can be solved by a combination of a Catalan formats.py patch (django/conf/locale/ca/formats.py) and changing that translations (via Transifex).
Actual:
DATE_FORMAT = r"j \d\e F \d\e Y"
msgid "January"
msgstr "gener"
msgid "April"
msgstr "abril"
{item.date | date} output -> 25 de gener de 2007
{item.date | date} output -> 4 de abril de 2014 ---> THIS IS WRONG
Proposal:
DATE_FORMAT = r"j E \d\e Y" # E placeholder: alt. month translations for special cases.
msgctxt "alt. month"
msgid "January"
msgstr "de gener"
msgctxt "alt. month"
msgid "April"
msgstr "d'abril"
{item.date | date} output -> 25 de gener de 2007
{item.date | date} output -> 4 d'abril de 2014
I'm trying to reach Catalan Transifex Team to add those strings, I think .po/.mo files won't follow the usual pull request way, but they must be changed before this file gets patched.
Alternative month representation is available since this https://code.djangoproject.com/ticket/12309#no1
Attachments (2)
Change History (12)
by , 3 years ago
Attachment: | patch.patch added |
---|
comment:1 by , 3 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 3 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Hi, thanks for the report.
… it is wrong when the month name starts with vowel like abril (April), agost (August) or octubre (October). In that case it should be d'abril, d'agost or d'octubre.
Yep, OK.
Let's accept; without reviewing fully, your explanation that we need to update the formats sounds likely.
Are you able to open a PR on GitHub with your patch? https://github.com/django/django/pulls
Moltes gràcies!
follow-up: 4 comment:3 by , 3 years ago
Cc: | added |
---|
follow-up: 5 comment:4 by , 3 years ago
Replying to Carlton Gibson:
I will open a PR as soon as we update django.po and django.mo for Catalan. Otherwise, if the PR gets merged without the translations update then DATE_FORMAT, DATETIME_FORMAT and MONTH_DAY_FORMAT will show an incomplete format for all months instead of a wrong format for 3 months.
If you think I should open it anyway, please tell me. Thanks.
follow-up: 7 comment:5 by , 3 years ago
Replying to mpachas:
Yes, I would open it anyway: it's easier to work with PRs than patch files (if only that we're already there, and seeing it in our list…)
Thanks
comment:6 by , 3 years ago
Description: | modified (diff) |
---|
comment:7 by , 3 years ago
Replying to Carlton Gibson:
Replying to mpachas:
Yes, I would open it anyway: it's easier to work with PRs than patch files (if only that we're already there, and seeing it in our list…)
Thanks
PR available at https://github.com/django/django/pull/15634, I've just get in touch with aaloy as Transifex coordinator for Django translations in Catalan.
comment:8 by , 3 years ago
Description: | modified (diff) |
---|
comment:9 by , 3 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
patch file for formats.py