Bug 6607

Summary: Auto-detect client locale and use for date formatting
Product: [Build System, Metadata & Runtime] Toaster Reporter: Paul Eggleton <bluelightning>
Component: toasterAssignee: brian avery <brian.avery>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Low CC: alejandro.delcastillo, alexandru.damian, belen.barros.pena, bill.pittman, cristiana.voicu
Version: unspecified   
Target Milestone: 2.3 M2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

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.