GÜNGÖR BUDAK

Bioinformatics Analyst at Seven Bridges & PhD Student at METU

Django/Mezzanine Content Translation for Mezzanine Built-in Applications

As Mezzanine comes with additional Django applications such as pages, galleries and to translate their content, Mezzanine supports django-modeltranslation integration.

Install django-modeltranslation:

pip install django-modeltranslation

Add following to the INSTALLED_APPS in settings.py:

"modeltranslation",

And following in settings.py:

USE_MODELTRANSLATION = True

Also, move mezzanine.pages to the top of other Mezzanine apps in INSTALLED_APPS in settings.py like so:

"mezzanine.pages",
"mezzanine.boot",
"mezzanine.conf",
"mezzanine.core",
"mezzanine.generic",
"mezzanine.blog",
"mezzanine.forms",
"mezzanine.galleries",
"mezzanine.twitter",
"mezzanine.accounts",
"mezzanine.mobile",

Run following to create fields in database tables for translations:

python manage.py sync_translation_fieldspython manage.py update_translation_fields

Also, migrations might be needed:

python manage.py makemigrationspython manage.py migrate

And done.