How to add translations to a Django project

Let's take a look at the process to internationalize our project. We will need to do the following:

  1. Mark strings for translation in our Python code and our templates
  2. Run the makemessages command to create or update message files that include all translation strings from our code
  3. Translate the strings contained in the message files and compile them using the compilemessages management command

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.