Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2408 closed defect (fixed)

[patch] trans_null doesn't have get_language_from_request

Reported by: ubernostrum Owned by: hugo
Component: Translations Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

There are situations where one might want to have the USE_I18N setting False, but still take advantage of LocaleMiddleware to populate the Content-Language header of the response. Unfortunately, LocaleMiddleware wants to do get_language_from_request to figure out which translation to use, and trans_null in django.utils.translation doesn't provide a method by that name.

Adding a 'dummy' method which just spits back the default language code of the Django installation would fix this.

Attachments (1)

trans_null.diff (360 bytes) - added by ubernostrum 9 years ago.
Patch to fix this

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by ubernostrum

Patch to fix this

comment:1 Changed 9 years ago by ubernostrum

  • Summary changed from trans_null doesn't have get_language_from_request to [patch] trans_null doesn't have get_language_from_request

comment:2 Changed 9 years ago by adrian

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

(In [3458]) Fixed #2408 -- Added get_language_from_request() to trans_null.py. Thanks, ubernostrum

Note: See TracTickets for help on using tickets.
Back to Top