wagtail / wagtailtrans

A Wagtail add-on for supporting multilingual sites
http://wagtailtrans.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

404 when the browser's language is Live, but the main page for this language is in Draft / missing #204

Open GrUnicrn opened 3 years ago

GrUnicrn commented 3 years ago

Issue summary

When the language (say, Spanish) is set to Live, but the main page for Spanish is in Draft or non-existing, the users with Spanish language set in their browsers will encounter a 404 error when accessing the website main page.

How to reproduce?

  1. Create a new language, say, Spanish. Set the Live checkbox to True.
  2. Change the language of your browser to Spanish.
  3. Delete the local website's django_language cookie.
  4. Navigate to your site without specifying the page (so http://127.0.0.1:8000/, not http://127.0.0.1:8000/en)
  5. Translate the English main page to Spanish, but keep the Spanish page in Draft
  6. Repeat step 4.

Expected result: The website falls back to default language (English)

Actual result: 404 error

Technical details