Bug 6607 - Auto-detect client locale and use for date formatting
Summary: Auto-detect client locale and use for date formatting
Status: RESOLVED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: unspecified
Hardware: All Multiple
: Low enhancement
Target Milestone: 2.3 M2
Assignee: brian avery
QA Contact:
URL:
Whiteboard:
: 6713 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-08-04 10:15 UTC by Paul Eggleton
Modified: 2016-12-14 20:05 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2014-08-04 10:15:36 UTC
It seems like there is support in Django for auto-detecting the client's locale (using HTTP headers), you just need to enable it:

http://www.janosgyerik.com/detect-language-preference-in-django-and-confirm-it-works/

We should enable this and ensure all places we display dates use the SHORT_DATETIME_FORMAT etc. when formatting dates.

https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
Comment 1 Alexandru Damian 2014-08-08 14:48:51 UTC
Assigning to Belen as to get input on this. Currently dates, etc, are designed in locale-independent manner throughout the application, i.e. they don't match any locale definition, not even US or UK.
Comment 2 Belen Barros Pena 2014-09-19 14:38:21 UTC
*** Bug 6713 has been marked as a duplicate of this bug. ***
Comment 3 Belen Barros Pena 2016-04-27 12:37:55 UTC
Moving this 2.2 after receiving some complaints about it. It would be nice to fix.
Comment 4 Belen Barros Pena 2016-04-27 15:51:27 UTC
We will just update the Toaster manual to explain you should set your timezone using the Django admin interface. This is to avoid having one time stamp in the logs and file names, and another one in the UI
Comment 5 brian avery 2016-12-14 20:05:53 UTC
UI uses timezone of build machine. USE_TZ in settings.py file.

If daylight savings time causes issues, add the pytz module.