#34515: prefix_default_language=False raises HTTP 404 for default language if
LANGUAGE_CODE != 'en'
-------------------------------------+-------------------------------------
               Reporter:  ab         |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  4.2
  (Other)                            |       Keywords:
               Severity:  Normal     |  internationalization, i18n,
           Triage Stage:             |  prefix_default_language
  Unreviewed                         |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 A simple django project with instruction to replicate the bug can be found
 here:
 [https://github.com/aboutofpluto/django-prefix-default-language-bug-report
 github repo]

 In brief: `prefix_default_language = False`  raises HTTP 404 for the
 default unprefixed pages if `LANGUAGE_CODE` is not "en".

 I think the problem is that the function `get_language_from_path` in
 `django/utils/translation/trans_real.py` returns `None` in case of failure
 instead of `LANGUAGE_CODE`:
 
[https://github.com/django/django/commit/94e7f471c4edef845a4fe5e3160132997b4cca81
 #diff-cc1f617ac65a58aec8f73b7a909c5bb48e0391543fe64c4f7ee22d4333a529efL585
 diff in 4.2]

 Consequently, other mechanisms are used to get the language (cookies or
 headers) that do not work neither.

 Related issue with my last comment adding some extra context:
 [https://code.djangoproject.com/ticket/34455]

 It is the first time I contribute to django, I hope the bug report is OK.
 I am also willing to write the patch and test if required.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34515>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187b78ce11c-f86e0fca-b445-4a09-8283-aefab53f403e-000000%40eu-central-1.amazonses.com.

Reply via email to