Reading stack overflow for a long time, first time I need to ask sth here.
The app is bilingual. I defined urls in urlpatterns to be translated with ugettext_lazy. User chooses first language and urls work, if he changes lang to the second one, it works also well.
But if user chooses first language and enters url in second lang, he gets 404, because there is no match, because urlpatterns are translated to first lang.
How could I force Django to check again urlpatterns translated to the second language? I want to display a page if it exists, as if url would be entered in the first lang.
I use LocaleMiddleware.
I thought about setting cookie and redirect, but if not found, in user url will be displayed url translated to the second lang, not what user entered, which can be misleading.
Any ideas?
Regards, Mike
Edit: I don't use those i18n patterns. I've got sth like:
url(_(r'^contact/'), include('contact.urls')),
and would like Django to display appropriate view regardless of chosen language. If the user types in /contact/ or translated to second language /kontakt/ the view should be shown.