Web applications usually are not limited to one geographical region or to serving people from one linguistic domain. For example, a web application intended for users in Europe will be expected to support other European languages such as German, French, Italian, Spanish, and so on, apart from English. This chapter will cover the basics of how to enable support for multiple languages in a Flask application.
In this chapter, we will cover the following recipes:
Adding a new language
Lazy evaluation and the gettext/ngettext functions
Global language-switching action