#12650: Some contrib apps depend on the i18n context processor to output valid
XHTML
------------------------------------+---------------------------------------
Reporter: robhudson | Owner: ramiro
Status: closed | Milestone:
Component: Uncategorized | Version: 1.1
Resolution: worksforme | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by ramiro):
* status: assigned => closed
* resolution: => worksforme
Comment:
I started to work on this by first creating a test case that set the
`USE_I18N` seting to False, removed
`'django.core.context_processors.i18n'` from the
TEMPLATE_CONTEXT_PROCESSORS setting and then examined the content of the
HTML tag of an admin page.
But it showed thing were working (the lang attributes had `"en-us"`
values) even before applying any fix.
Looking at the Django code I see that the i18n context processor sets the
`LANGUAGE_CODE` context var value from the result of a call to
`django.utils.translation.get_language()` and
`django/utils/translation/trans_null.py` (the one used when `USE_i18N` is
False) has `get_language = lambda: settings.LANGUAGE_CODE`. So
`LANGUAGE_CODE` never can have and empty value.
Tested this against trunk and 1.1.x as of now.
The only other possibility I seas a a reason for getting an empty
`LANGUAGE_CODE` context var value is if you are explicitly deleting the
`LANGUAGE_CODE` setting or setting it to an empty value which isn't the
right way to deactivate i18n machinery.
Because of this I'm closing this ticket as ''worksforme''. Please reopen
If I've missed anything.
--
Ticket URL: <http://code.djangoproject.com/ticket/12650#comment:5>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.