[Django] #34784: Django french short date format translation bug

20 views
Skip to first unread message

Django

unread,
Aug 18, 2023, 8:44:32 AM8/18/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier | Owner: nobody
Pons |
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization | Keywords:
Severity: Normal | translation,french,date
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This bug has persisted for over 8 years:

English: `SHORT_DATE_FORMAT = "m/d/Y"`

In French, it should be: `SHORT_DATE_FORMAT = "d/m/Y"`

However, it's currently set to: `SHORT_DATE_FORMAT = "j N Y"`

This results in an incorrect translation:

For English: "`08/18/2023`" should translate to "`18/08/2023`" for a
"short" format.

But as it stands now:
English: "`08/18/2023`" translates to "`18 août 2023`", which is not an
expected short date format.

As a workaround, we're using Babel, which returns the correct short
version = "`d/m/Y`":

{{{
#!python
from datetime import date
from babel.dates import format_date
from django.utils.translation import get_language

formatted_date = format_date(date.today(), "short",
locale=get_language())`
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34784>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 18, 2023, 11:59:46 AM8/18/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody

Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
translation,french,date | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Claude Paroz (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:1>

Django

unread,
Aug 20, 2023, 11:03:36 AM8/20/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
translation,french,date | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Stephane Raimbault (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:2>

Django

unread,
Aug 21, 2023, 5:01:48 AM8/21/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* stage: Unreviewed => Accepted


Comment:

Makes sense. However, as the real short format is different at least
between fr_FR (d/m/Y), fr_CH (d.m.Y), and fr_BE (d.m.Y), a proper
resolution would be to provide formats.py-only specific locale for fr_CH
and fr_BE. (this may be the reason for the current value)

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:3>

Django

unread,
Aug 21, 2023, 5:25:02 AM8/21/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Olivier Pons):

Perhaps the official version is "`d.m.Y`" – I haven't really checked
precisely. It will always be better than the current version.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:4>

Django

unread,
Aug 21, 2023, 12:20:17 PM8/21/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

No, we have to differentiate between fr (or fr_FR) and fr_CH/fr_BE.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:5>

Django

unread,
Aug 22, 2023, 7:15:43 PM8/22/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Amir Karimi):

So, it seems if we just copy fr folder and paste it as fr_CH like what we
have done for es, and just separate fr_CH/BE from fr, it will be resolved.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:6>

Django

unread,
Aug 23, 2023, 6:29:30 AM8/23/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Olivier Pons):

We should not only copy the `fr` folder and rename it as `fr_CH` (like we
did for `es`), and distinguish between `fr_CH` / `fr_BE` and `fr`, but
also change the date format in the `fr_FR` version from "`j N Y`" to
"`d/m/Y`". Doing so should resolve the issue."

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:7>

Django

unread,
Aug 23, 2023, 11:31:14 AM8/23/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/17187 Suggested PR]. This would
need confirmation by Belgian/Canadian French speakers.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:8>

Django

unread,
Aug 25, 2023, 12:21:38 AM8/25/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: assigned

Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Claude Paroz
* needs_better_patch: 0 => 1
* status: new => assigned


Comment:

Waiting for `fr_CA` formats.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:9>

Django

unread,
Aug 26, 2023, 10:01:41 AM8/26/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 1 => 0


Comment:

Submitted the fr_CA variant.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:10>

Django

unread,
Aug 26, 2023, 4:48:02 PM8/26/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Olivier Pons):

Thank you for the detailed discussion on the date format variations across
different French locales. I appreciate the insights. Which
Belgian/Canadian French speakers are qualified and accredited to validate
this ticket and provide a final decision on the proposed changes?

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:11>

Django

unread,
Aug 27, 2023, 4:58:52 AM8/27/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
translation,french,date |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

I don't think any decision has to be made. It's a matter of finishing the
patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:12>

Django

unread,
Aug 28, 2023, 3:39:05 PM8/28/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
translation,french,date | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:13>

Django

unread,
Aug 28, 2023, 11:52:25 PM8/28/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
translation,french,date | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1ac397674b2f64d48e66502a20b9d9ca6bfb579a" 1ac39767]:
{{{
#!CommitTicketReference repository=""
revision="1ac397674b2f64d48e66502a20b9d9ca6bfb579a"
Refs #34784 -- Added fr_CA locale formats.

Formating rules sourced from
- https://www.btb.termiumplus.gc.ca/tpv2guides/guides/clefsfp/index-
fra.html?lang=fra&lettr=indx_catlog_d&page=9lcOojjUrxt8.html
- https://vitrinelinguistique.oqlf.gouv.qc.ca/21241/la-typographie/nombres
/ecriture-des-dates-et-des-heures-dans-certains-contextes-techniques
- https://en.wikipedia.org/wiki/Date_and_time_notation_in_Canada
- https://metacpan.org/dist/DateTime-
Locale/view/lib/DateTime/Locale/fr_CA.pod
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:15>

Django

unread,
Aug 28, 2023, 11:52:25 PM8/28/23
to django-...@googlegroups.com
#34784: Django french short date format translation bug
-------------------------------------+-------------------------------------
Reporter: Olivier Pons | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: | Version: 4.2
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
translation,french,date | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fdf14cfc01558bfa6f990560d38531c82fb5c024" fdf14cf]:
{{{
#!CommitTicketReference repository=""
revision="fdf14cfc01558bfa6f990560d38531c82fb5c024"
Fixed #34784 -- Adjusted SHORT_DATE_FORMAT in various French variants.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34784#comment:14>

Reply all
Reply to author
Forward
0 new messages