#30272: get_language_from_request(..., check_path=True) not respecting
i18n_patterns prefix_default_language=False
--------------------------------------+------------------------------------
     Reporter:  Stefan Wehrmeyer      |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Internationalization  |                  Version:  2.1
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1
 * has_patch:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 Hi Stefan,

 I'm going to provisionally accept this, but ask for a review from others.

 Looking at 85a4844f8a8e628b90fa30ba7074f162a2d188ef, it's clear that we
 should (and do) serve the default language, ignoring `Accept-Language`,
 so, yes, plausibly, matching that in `get_language_from_request()`, when
 using `check_path`, would be correct.

 I've
 
[https://github.com/django/django/pull/11123/commits/eaaa07ca971c2d19bc166e0750d043a49ba575fd
 added a very minimal port of the logic from `LocaleMiddleware` to
 `get_language_from_request()` on your PR]. Suitably tidied this might
 resolve the issue. (We'll see what CI says, but the change looks like it
 doesn't break anything...)

 I've retitled the issue: `get_language_from_path()` doesn't have access to
 e.g. the `request`, so can't house the right logic here.
 `get_language_from_request()` is our target.

 Thanks for taking the time to explain the issue.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30272#comment:7>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3435de3e2eb74ee335a5326b366828d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to