Code

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13702 closed (fixed)

DATE_FORMAT et al not used when USE_L10N is False

Reported by: kmtracey Owned by: jezdez
Component: Internationalization Version: 1.2
Severity: Keywords:
Cc: intgr Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If I set USE_L10N to False in settings.py, dates in the admin changelist (at least) do not fall back from using the locale DATE_FORMAT to the settings DATE_FORMAT as is implied by the doc. Rather the no-frills date str/unicode formatting is used. Problem may be that the localize function in utils (http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/utils/formats.py#L77) does not do anything if USE_L10N is False, or perhaps the caller is supposed to do something else if USE_L10N if False...but the admin, at least, does not: http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/contrib/admin/util.py#L316. Some code somewhere ought to be falling back to the old settings values, but as far as I can see none is.

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by aaloy

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

There is another ticket realted DATE_FORMAT and USE_L10N http://code.djangoproject.com/ticket/13621. In the list Malcom has explained that they made some changes on 1.2.1 to avoid some threading issues with Python date conversion functions,but it seems the chage has other side effects.

comment:2 Changed 4 years ago by jezdez

  • Owner changed from nobody to jezdez
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by intgr

  • Cc intgr added

comment:4 Changed 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [13770]) Fixed #13702 -- Made sure to actually fall back to the l10n format strings provided in the settings, when disabled.

comment:5 Changed 4 years ago by jezdez

(In [13771]) [1.2.X] Fixed #13702 -- Made sure to actually fall back to the l10n format strings provided in the settings, when disabled.

Backport from trunk (r13770).

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.