I'm looking into bringing React into my codebase(pyramid, jinja2). It almost looks like a good fit. I'm just confused as to how to handle translations from python. I'm using the
Ended up using https://github.com/webpack/i18n-webpack-plugin and serving up the specific bundle file based on a saved language setting.
So on the backend we store in the database which language a user wants to use. We have json files of translations for all the languages & words we support. When compiling the bundle files with this plugin we get a bundle for each language that uses those json files to swap out the translated words. So something like bundle.en.js for english and bundle.es.js for spanish. When a user requests a page we serve up the bundle file associated with their selected language stored in the DB.