#28556: resolve of i18n_patterns does not match default language paths with
prefix_default_language=False
-------------------------------------+-------------------------------------
Reporter: nielsole | Owner: nobody
Type: Bug | Status: new
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution:
Keywords: i18n, reverse | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by nielsole:
Old description:
> I believe this to be a follow-up of #27402
>
> ### urls.py
> urlpatterns += i18n_patterns(
> url(r'^', include('main.urls', namespace="main")),
> prefix_default_language=False)
> ###
>
> Now in a custom tag I try to resolve the URL(e.g. '/login/',
> '/en/login/'). This fails if the path is not prefixed(e.g. '/login/'):
> ### my_custom_tag
> path = context['request'].path
> url_parts = resolve(path) # raises 404
> ###
>
> My version: 1.11.4
> Sorry for the brief bug report, but my laptop is running out of battery
> and I don't have a charger
New description:
I believe this to be a follow-up of #27402
### urls.py
{{{
urlpatterns += i18n_patterns(
url(r'^', include('main.urls', namespace="main")),
prefix_default_language=False)
}}}
Now in a custom tag I try to resolve the URL(e.g. '/login/',
'/en/login/'). This fails if the path is not prefixed(e.g. '/login/'):
### my_custom_tag
{{{
path = context['request'].path
url_parts = resolve(path) # raises 404
}}}
The URL of course exists as it is the current URL directly from the
context.
My version: 1.11.4
Sorry for the brief bug report, but my laptop is running out of battery
and I don't have a charger
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28556#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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.4ad693bfe7b7eedd64c1a2d2875b8040%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.