Using the Rosetta translation interface

Rosetta is a third-party application that allows you to edit translations using the same interface as the Django administration site. Rosetta makes it easy to edit .po files and it updates compiled translation files. Let's add it to our project.

Install Rosetta via pip using this command:

pip install django-rosetta==0.8.1

Then, add 'rosetta' to the INSTALLED_APPS setting in your project's settings.py file as follows:

INSTALLED_APPS = [    # ...    'rosetta',]

You need to add Rosetta's URLs to your main URL configuration. Edit the main urls.py file of your project and add the following URL pattern to it:

urlpatterns = [    # ...    path('rosetta/', include('rosetta.urls')), path('', include('shop.urls', namespace='shop')), ...

Get Django 2 by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.