qhana_plugin_runner.babel module

Module for setting up Babel support for flask app.

qhana_plugin_runner.babel.get_locale()
qhana_plugin_runner.babel.inject_lang_from_header()

Inject the language defined in the custom ‘lang’ Hader into the g context.

This method can be used in a before request callback to read the custom header and use that to set the language for example for API requests.

qhana_plugin_runner.babel.register_babel(app: Flask)

Register babel to enable translations for this app.