O'Reilly logo

Django Project Blueprints by Asad Jibran Ahmed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required