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 your project.
Install Rosetta via pip
using this command:
pip install django-rosetta==0.9.8
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 highlighted in bold:
urlpatterns = [
path('admin/', admin.site.urls),
path('cart/', include('cart.urls', namespace='cart')),
path('orders/', include('orders.urls', namespace='orders')),
path(...