Adding Internationalization to Your Shop
In the previous chapter, you added a coupon system to your shop and built a product recommendation engine.
In this chapter, you will learn how internationalization and localization work.
This chapter will cover the following points:
- Preparing your project for internationalization
- Managing translation files
- Translating Python code
- Translating templates
- Using Rosetta to manage translations
- Translating URL patterns and using a language prefix in URLs
- Allowing users to switch language
- Translating models using
django-parler
- Using translations with the ORM
- Adapting views to use translations
- Using localized form fields of
django-localflavor
The source code for this chapter can be found at https://github.com/PacktPublishing/Django-4-by-example/tree/main/Chapter11.
All the Python modules used in this chapter are included in the requirements.txt
file in the...