#35242 closed Bug (needsinfo)
LANGUAGE_CODE = "fr-CA" provide incorrect TIME_FORMAT
Reported by: | matisa | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | 5.0 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
from django.utils import translation
from django.utils.formats import get_format
# Temporarily activate the "fr-CA" locale
translation.activate('fr-CA')
# Get date and time formats
date_format = get_format('DATE_FORMAT')
time_format = get_format('TIME_FORMAT')
datetime_format = get_format('DATETIME_FORMAT')
print("Date format:", date_format)
Date format: j F Y
print("Time format:", time_format)
Time format: H h i <<<<<< This is wrong
print("Datetime format:", datetime_format)
Datetime format: j F Y, H h i
Change History (2)
comment:2 by , 9 months ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
The correct way to represent time in the fr-CA locale is using h
as a separator for hours and minutes.
- https://www.btb.termiumplus.gc.ca/redac-chap?lang=eng&lettr=chapsect1&info0=1.1.12
- https://metacpan.org/dist/DateTime-Locale/view/lib/DateTime/Locale/fr_CA.pod
What source are you using to determine that the format is wrong? Locale was added 6 months ago in 1ac397674b2f64d48e66502a20b9d9ca6bfb579a.
Overriding the folmat in the settings file does not work either
TIME_FORMAT = "H:i"