From f200d8369822e418906579503b8d3015a03e75f0 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 28 Apr 2023 08:05:43 +0200 Subject: [4.2.x] Fixed #34515 -- Made LocaleMiddleware prefer language from paths when i18n patterns are used. Regression in 94e7f471c4edef845a4fe5e3160132997b4cca81. This reverts commit 94e7f471c4edef845a4fe5e3160132997b4cca81 (refs #34069) and partly reverts commit 3b4728310a7a64f8fcc548163b0aa5f98a5c78f5. Thanks Anthony Baillard for the report. Co-Authored-By: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Backport of 0e444e84f87d174713a2aef0c4f9704ce2865586 from main --- docs/releases/4.2.1.txt | 5 +++++ docs/releases/4.2.txt | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/releases/4.2.1.txt b/docs/releases/4.2.1.txt index 151d16466f..a1130effe8 100644 --- a/docs/releases/4.2.1.txt +++ b/docs/releases/4.2.1.txt @@ -31,6 +31,11 @@ Bugfixes ``prefix_default_language`` argument when a fallback language of the default language was used (:ticket:`34455`). +* Fixed a regression in Django 4.2 where translated URLs of the default + language from ``i18n_patterns()`` with ``prefix_default_language`` set to + ``False`` raised 404 errors for a request with a different language + (:ticket:`34515`). + * Fixed a regression in Django 4.2 where creating copies and deep copies of ``HttpRequest``, ``HttpResponse``, and their subclasses didn't always work correctly (:ticket:`34482`, :ticket:`34484`). diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index b113f3d217..d923be55b8 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -248,10 +248,6 @@ Internationalization * Added support and translations for the Central Kurdish (Sorani) language. -* The :class:`~django.middleware.locale.LocaleMiddleware` now respects a - language from the request when :func:`~django.conf.urls.i18n.i18n_patterns` - is used with the ``prefix_default_language`` argument set to ``False``. - Logging ~~~~~~~ -- cgit v1.3