Opened 8 years ago

Closed 8 years ago

Last modified 7 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



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 Changed 8 years ago by Jannis Leidel

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

comment:2 Changed 8 years ago by Jannis Leidel

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 Changed 7 years ago by masterjakul@…

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