Opened 3 years ago

Last modified 3 years ago

#33661 closed Bug

Fix Catalan formats.py to use alt.month — at Initial Version

Reported by: mpachas Owned by: nobody
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

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 "enero"

msgid "April"
msgstr "abril"

{item.date | date} output -> 25 de enero 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 enero"

msgctxt "alt. month"
msgid "April"
msgstr "d'abril"

{item.date | date} output -> 25 de enero 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

Change History (1)

by mpachas, 3 years ago

Attachment: patch.patch added

patch file for formats.py

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