Translating our models

The last thing that we want to look at is how to translate our model data. Open the site and change to the French language. Your home page should be similar to the following screenshot:

Translating our models

You will notice that even though the static content—the one that we put in the template ourselves—is translated, the dynamic names of the movies are not. While this is acceptable for some sites, your model data should be translated as well in order to be truly internationalized. Django by default does not have any built-in method to achieve this, but it's pretty easy.

Tip

What I'm about to show you is something that the Django modeltranslation ...

Get Django Project Blueprints 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.