5

I need to create a web app that can support dual languages namely English and Japanese. I don't need a translator, just a workflow for displaying text based on a user preference.

Is there such a framework where I don't have to reinvent the weel? Or do I have to create two separate sites?

2 Answers 2

9

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

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.