Handling multilingual fields
Django uses the internationalization mechanism to translate verbose strings in the code and templates. However, it's up to the developer to decide how to implement the multilingual content in the models. There are several third-party modules that handle translatable model fields; however, I prefer the simple solution that will be introduced to you in this recipe.
The advantages of the approach that you will learn about are as follows:
- It is straightforward to define multilingual fields in the database
- It is simple to use the multilingual fields in database queries
- You can use contributed administration to edit models with the multilingual fields without additional modifications
- If you need it, you can easily show all the ...
Get Web Development with Django Cookbook - Second Edition 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.