After the refactor in python-babel/flask-babel#163 there is no longer support for defining different translation domains for different translation directories. @ThiefMaster mentioned in #163 that it superseded the now closed #148, but I haven't been able to figure out how multiple domains could be supported in the new version. AFAICT, when loading the translations, a single domain is always used, thus preventing loading translations from directories that use a different domain:
Adds support for loading translations from different domains in the same Flask-Babel instance.
To be clear, our application (CKAN) supports the following setup for translations:
After the refactor in python-babel/flask-babel#163 there is no longer support for defining different translation domains for different translation directories. @ThiefMaster mentioned in #163 that it superseded the now closed #148, but I haven't been able to figure out how multiple domains could be supported in the new version. AFAICT, when loading the translations, a single domain is always used, thus preventing loading translations from directories that use a different domain:
https://github.com/python-babel/flask-babel/blob/ec7ae9ed2e22c7aebd4e732c1c3dc6d45fe8db76/flask_babel/__init__.py#L564
This change adds support for a semi-colon separated list of domains in
BABEL_DOMAIN
, that must match a list passed toBABEL_TRANSLATION_DIRECTORIES
.I'm not sure if there is a more elegant way to achieve the same result but happy to change the approach.