Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multilanguage site returns 404 #6658

Open
EnriqueAnakena opened this issue Mar 27, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@EnriqueAnakena
Copy link

commented Mar 27, 2019

Summary

When creating a new page from backend using a spanish browser the new page returns 404 even trying the english url of the site, until you create the spanish page then return the english if using english version.
Also a page with a cms app it always returns the spanish version if using a browser with default lang Spanish.
This happens due to the LocaleMiddleware, responding with the Accepted Languages header, even if the page does not exist.

Expected behaviour

When creating a page only in one version (english) even if using a spanish browser it should return the english version if using the url from the english site (it does not contain the language in the path).
Accessing a page with a cms app should return the expected language

Actual behavior

Due to the LocaleMiddleware and not using the language in the url returns the Accepted language header, making the page return a 404 or the spanish version making impossible to access the english content.

Environment

  • Python version:3.5.3
  • Django version:1.11.16
  • django CMS version:3.5.3

Language configuration:

# LANGUAGE START
LANGUAGE_CODE = 'en'
TIME_ZONE = 'Europe/Madrid'
USE_I18N = True
USE_L10N = True
USE_TZ = True
LANGUAGES = [
    ('en', 'English'),
    ('es', 'Español'),
]
CMS_LANGUAGES = {
    1: [
        {
            'code': 'en',
            'name': 'English',
            'fallbacks': [],
        },
        {
            'code': 'es',
            'name': 'Español',
            'fallbacks': [],
        },
    ],
    'default': {
        'public': True,
        'redirect_on_fallback': False,
        'hide_untranslated': False,
        'fallbacks': [],
    }
}
PTM_DEFAULT_LANGUAGE = 'en'
# LANGUAGE END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.