2

I am trying to add multilingual support for a django-cms site on the divio platform. I believe the relevant divio docs are outdated, in that there no longer exists a "General Settings" link in the sidebar to add Languages via the divio web interface as described in the link above. Instead there is now a "Settings" link but there is no language field there.

screenshot of divio interface

I have, therefore, manually added the following into my settings.py file:

from django.utils.translation import gettext_lazy as _

LANGUAGES = [
    ("en", _("English")),
    ("de", _("German")),
    ("es", _("Spanish")),
]

CMS_LANGUAGES = {
    1: [
        {"code": "en", "name": _("English"), "fallbacks": ["de", "es"], "public": True},
        {"code": "de", "name": _("German"), "fallbacks": ["en", "es"], "public": True},
        {"code": "es", "name": _("Spanish"), "fallbacks": ["en", "de"],
            "public": False,},
    ],
    "default": {
        "fallbacks": ["en", "de", "es"],
        "redirect_on_fallback": True,
        "public": True,
        "hide_untranslated": False,
    },
}

PARLER_LANGUAGES = {
    1: ({"code": "en"}, {"code": "de"}, {"code": "es"}),
    "default": {
        "fallbacks": ["en", "de", "es"],
        "hide_untranslated": False, 
    },

All seems to work fine, but there is a small issue with the translations column in list_display (in admin), when instead of the actual translation links, the links appear as strings as you can see in the following screenshot of the aldryn-newsblog article list:

Screenshot of aldryn-newsblog article list

In the background, this list_display entry is added by aldryn_translation_tools and it seems that for some reason, a string is appended instead in the html instead of the anchor tags. As in:

<td>
  "<a></a>"
</td>

Instead of:

<td>
  <a></a>
</td>

Any ideas on what may be causing this? Are my configuration settings correct?

fekioh
  • 894
  • 2
  • 9
  • 22

1 Answers1

1

Thanks for pointing out the outdated help article, we'll get it updated.

The language settings are now in the Aldryn Django addon configuration: Addons > Aldryn Django.

Of course you can also have your languages settings in settings.py instead.

Daniele Procida
  • 1,477
  • 10
  • 27
  • Thanks. FYI - the specific issue with the language-code links not appearing correctly, seems to be related to the django version. It was resolved when I downgraded from 2.1.x to 1.11.x – fekioh Sep 04 '19 at 11:29