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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With