Opened 7 weeks ago

Last modified 3 weeks ago

#36543 assigned Bug

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: Accepted
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 (8)

comment:1 by Natalia Bidart, 7 weeks 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, 7 weeks ago

fr_CA format was added in #34784.

comment:3 by Mridul, 7 weeks 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, 6 weeks ago

Needs tests: set

comment:6 by Mridul, 6 weeks ago

Needs tests: unset

comment:7 by Sarah Boyce, 5 weeks ago

Patch needs improvement: set

comment:8 by Mridul, 3 weeks ago

Patch needs improvement: unset
Note: See TracTickets for help on using tickets.
Back to Top