Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16909 closed Bug (fixed)

django.utils.formats.get_format function uses wrong language

Reported by: defaultwombat Owned by: Jannis Leidel
Component: Internationalization Version: 1.3
Severity: Normal Keywords: l10n get_format lang
Cc: masterjakul@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django/utils/formats.py

The lang argument in the get_format() function is not used for picking the right language module, as the get_format_modules() function always used the language from get_language().

Actually the language is only used for the cache key so the result of the wrong module will be cached.

As get_format_modules() is only used in get_format() and django.views.i18n.get_formats() I think its save to add an optinal lang=None argument to its definition.

Change History (3)

comment:1 by Jannis Leidel, 13 years ago

Owner: changed from nobody to Jannis Leidel
Triage Stage: UnreviewedAccepted

comment:2 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: newclosed

In [16884]:

Fixed #16909 -- Pass language to get_format_modules when calling it from get_format to make sure the correct module is returned.

comment:3 by masterjakul@…, 13 years ago

Cc: masterjakul@… added
Note: See TracTickets for help on using tickets.
Back to Top