Opened 2 months ago

Closed 3 weeks ago

Last modified 3 weeks ago

#36543 closed Bug (fixed)

French Canadian locale formats times incorrectly

Reported by: Anderson, Chris Owned by: Mridul
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Claude Paroz, Simon Charette 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

The fr_CA locale uses the format string H\xa0h\xa0i as its time format and as the time portion of its datetime formats. The comments indicate this should be producing output like 13 h 40 however, because h is the flag for 12-hour time, this instead gets formatted like 13 01 40. The format strings should be updated to escape the h character.

Change History (11)

comment:1 by Natalia Bidart, 2 months ago

Cc: Claude Paroz Simon Charette added
Triage Stage: UnreviewedAccepted
Version: 5.2dev

Thank you @Chris-Anderson_JLLT, I managed to reproduce using:

import django
from django.utils import timezone, translation, formats
from datetime import time
django.setup()
translation.activate('fr-ca')
print("Formatted time:", formats.time_format(time(13, 40)))

Which shows:

Formatted time: 13 01 40

comment:2 by Natalia Bidart, 2 months ago

fr_CA format was added in #34784.

comment:3 by Mridul, 2 months ago

Owner: set to Mridul
Status: newassigned

I would love to work on this ticket and will make sure to provide updates on the ticket as I make progress

comment:5 by Natalia Bidart, 2 months ago

Needs tests: set

comment:6 by Mridul, 2 months ago

Needs tests: unset

comment:7 by Sarah Boyce, 2 months ago

Patch needs improvement: set

comment:8 by Mridul, 7 weeks ago

Patch needs improvement: unset

comment:9 by Sarah Boyce, 3 weeks ago

Triage Stage: AcceptedReady for checkin

comment:10 by Sarah Boyce <42296566+sarahboyce@…>, 3 weeks ago

Resolution: fixed
Status: assignedclosed

In b67a36ec:

Fixed #36543 -- Fixed time formats for fr_CA.

Thanks Chris Anderson for the report.

comment:11 by Sarah Boyce <42296566+sarahboyce@…>, 3 weeks ago

In b15f8ba0:

[6.0.x] Fixed #36543 -- Fixed time formats for fr_CA.

Thanks Chris Anderson for the report.

Backport of b67a36ec6f5895f3fa6147264bae55cb014fa2a7 from main.

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