#16449: i18n_pattern URLs reversed from shell and tests have incorrect language
prefix
-------------------------------------+-------------------------------------
Reporter: jakub | Owner: nobody
Type: Bug | Status: closed
Milestone: | Component: Translations
Version: SVN | Severity: Normal
Resolution: | Keywords: urlconf, reverse,
worksforme | i18n_patterns, tests, shell
Triage Stage: | Has patch: 0
Unreviewed | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by jezdez):
* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0
Comment:
That has something to do with how the base management command sets the
current language to `en-us` by default, not `settings.LANGUAGE_CODE`.
See
https://code.djangoproject.com/browser/django/trunk/django/core/management/base.py?rev=13993#L202
for the explanation.
Simply use `translation.activate(settings.LANGUAGE_CODE)` or similar to
enable the language you need before reversing the URL you want.
--
Ticket URL: <https://code.djangoproject.com/ticket/16449#comment:1>
Django <https://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.