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

default language options being ignored #6703

Open
nkhumphreys opened this issue Jul 16, 2019 · 0 comments

Comments

@nkhumphreys
Copy link

commented Jul 16, 2019

Summary

We have a Django CMS site that has several supported languages listed in the CMS_LANGUAGES conf dict as follows:

CMS_LANGUAGES = {
    1: [
        {
            'code': 'en',
            'name': gettext('English'),
            'public': True,
            'redirect_on_fallback': False,
        },
        {
            'code': 'de',
            'name': gettext('German'),
            'fallbacks': ['en'],
            'public': True,
            'hide_untranslated': True,
            'redirect_on_fallback': True,
        },
        {
            'code': 'ja',
            'name': gettext('Japanese'),
            'fallbacks': ['en'],
            'public': True,
            'hide_untranslated': True,
            'redirect_on_fallback': True,
        },
    ],
    'default': {
        'fallbacks': ['en'],
        'redirect_on_fallback': True,
        'public': True,
        'hide_untranslated': True,
    }
}

With the default setting that we believe should catch the case when a user requests a language that we do not intend to support translations for.

Expected behaviour

When a user visits a page for a language that is in this list, but is not available in their chosen language, the site behaves as expected and redirects the user to the en version of the site, for example example.org/ja/test redirects to example.org/en/test if the ja translations is not available. We would expect this behaviour for all languages, not just the ones we want to support translations for.

Actual behaviour

However, if a user requests the es version (which is not in the above list) we return a 404 rather than use the default setting (which should redirect the user to the en version).

I have tested this by adding es to the supported list in the CMS_LANGUAGES config and it then behaves as expected, and redirects the user to the en page.

Environment

  • Python version: 2.7.12
  • Django version: 1.11.21
  • django CMS version: 3.4.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.