Internationalizing URL Patterns Redirect should be 404
|Reported by:||James Addison||Owned by:||Jannis Leidel|
|Severity:||Normal||Keywords:||url patterns, internationalization|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Consider the following settings:
USE_I18N = True LANGUAGES = ( ('en', gettext('English')), ('fr', gettext('French')), )
with url patterns as follows:
urlpatterns = i18n_patterns('', url(r'^$', 'core.views.index', name='index'), )
Assuming my system/browser is is set with the en-us locale, if I browse to example.com/ it will redirect to example.com/en/ as expected. If I browse to example.com/en/ or example.com/fr/ it will display the page with no redirects, again as expected. If I browse to example.com/de/ it redirects to example.com/en/de/ - not what I would expect or want.
I believe it should a) simply issue a 404 OR b) possibly issue a 404 by default but allow the user to override this behaviour via a setting to substitute a custom view. The latter would allow developers to have a "this page is not available in this language" along with some custom logic gather user feedback - this might be overreaching for where 1.4 is in the release cycle.
Change History (5)
comment:1 Changed 5 years ago by
|Patch needs improvement:||unset|
|Severity:||Release blocker → Normal|