Python, flask and creating a dual language app Python, flask and creating a dual language app flask flask

Python, flask and creating a dual language app


Multilingual websites are generally created using gettext (which is supported in many systems, including Django and also Flask). I have not used it personally but Flask-Babel appears to be the package that you need.

The basic idea is: you mark all English strings as translatable and you can then create translation files for other languages, such as Japanese. You can then load the strings from the appropriate language when a page is requested (in Django this is done automatically after some configuration, I can imagine it to be similar in Flask).


Use python's gettext package for managing the multi language text and then set the language based on the 'Accept-Language' header or some URL parameter.