Closed arjanvaneersel closed 9 years ago
Hi ArieVanE, we've been very busy, we just released a new version with support for StreamFields, and fix some small issues. We'll look at your problem very soon.
ArieVanE, your context processor is unneeded. In your template you can use
{% load i18n %}
{% get_available_languages as LANGUAGES %}
{% get_current_language as LANGUAGE_CODE %}
But how to switch languages as you are trying to do is something I am yet to learn. Hopefully soon though
ArieVanE, to switch languages from a dropdown you can follow the tutorial at this link. It worked for me.
http://machakux.appspot.com/blog/17010/django_using_i18n_patterns_and_locale_switcher
This was fixed here https://github.com/infoportugal/wagtail-modeltranslation/pull/32
I'm using the wagtail demo and I have made the HomePage translatable according your instructions. In the admin this works fine.
Now I amended the home_page.html template with this:
To make sure that languages has a value I wrote a tiny context processor:
And settings.LANGUAGES is defined like this (in compliance with the instructions from django-model-translation): gettext = lambda s: s LANGUAGES = ( ('en', gettext('English')), ('nl', gettext('Dutch')), ('bg', gettext('Bulgarian')), )
Unfortunately this doesn't seem the way to do it, because the returned urls are None, for example:
What am I doing wrong?