Django 1.10, Issues with prefix_default_language

193 views
Skip to first unread message

Keith Hackbarth

unread,
Aug 12, 2016, 12:47:28 PM8/12/16
to Django users
I'm having two issues with "prefix_default_language" that I was hoping to shed some insight on. My URL conf is as follows:

urlpatterns += i18n_patterns(
    url
(r'^(?P<city>.+-parking)/?$', CityView.as_view()),
    prefix_default_language
=False
)

Issue #1: Prefixes

If a city that matches my regex ALSO begins with a language, it translates that language. For example: /de-moines-parking translates into German. I would expect /de-moines-parking to be in english and /de/de-moines-parking to be in German.

Issue #2: Stacking

Currently, the il8n_patterns is also allowing language tags to stack. For example, /de/fr/it/de-moines-parking is loading a successful page instead of a 404.

Any insight? Is this a bug or am I missing something obvious in my regex?

Thanks,

Keith


 
Reply all
Reply to author
Forward
0 new messages