#34853: Accept-Language Header takes precedence over cookie for format
localization
-------------------------------------+-------------------------------------
Reporter: blue-hexagon | Owner: nobody
Type: Bug | Status: closed
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution: invalid
Keywords: l10n format | Triage Stage:
localization | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Michael):
Replying to [comment:14 Claude Paroz]:
> I had a look at your issue. This is an issue with the `<input
type="date">` widgets. And this is exactly why Django doesn't use
`type="date"` by default. With those inputs, browsers are forcing their
content to the format of the current active browser locale, whatever the
language of the page language. So Django cannot do anything to change
that.
>
> Read the last comment of #34660 and the tickets/discussion it
references.
Correct me if I am understanding you incorrectly, but what I think you are
saying is Django does not provide a `<input type="date">` because the
`value` should be set according to the active browser's locale, which
Django doesn't know server side? If that is what you are saying, I
disagree, it is always in the format "YYYY-MM-DD", see:
Date input on MDN: https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/input/date
Date Time Format on MDN: https://developer.mozilla.org/en-
US/docs/Web/HTML/Date_and_time_formats#date_strings
> HTML uses a variation of the ISO 8601 standard for its date and time
strings.
It would be very simple to have Django render date value's server side
such that it works correctly with `<input type="date">`, it just has to do
less ....like in Django 4, instead of forcing the default language's
DATE_INPUT_FORMAT to the settings language.
I opened an issue about this recently:
https://code.djangoproject.com/ticket/35314?replyto=8#comment
--
Ticket URL: <https://code.djangoproject.com/ticket/34853#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018e534a376a-a8b7ca61-a19b-47f8-9fe1-53ace4271af7-000000%40eu-central-1.amazonses.com.