python-babel / flask-babel

i18n and l10n support for Flask based on Babel and pytz
https://python-babel.github.io/flask-babel/
Other
444 stars 159 forks source link

Support for different text domains #91

Closed amercader closed 7 years ago

amercader commented 8 years ago

Both gettext and Babel make heavy use of what is called the text domain or message domain [1]. This essentially is a unique name that identifies the application, and it's also used to name the pot, po and mo files. The code and the documentation currently assume that the domain is always messages, which is fine for a standalone application. But when integrating with other applications or migrating old code bases you might need to use a different domain.

This patch adds a new optional configuration option to define the domain.

It also adds documentation for the BABEL_TRANSLATION_DIRECTORIES option added on 11c7b29fe.

[1] https://www.gnu.org/software/gawk/manual/html_node/Explaining-gettext.html

TkTech commented 8 years ago

I'm trying a different take on this based on one of the earlier PRs to allow multi domains without having to create multiple Babel objects. I'd love your feedback on its usability once it's up and if it'll work for the use cases in ckan.

sh4nks commented 8 years ago

Any chance to get this (or something like this) merged?

TkTech commented 7 years ago

@amercader if you can resolve the conflicts I'm good with merging this.

amercader commented 7 years ago

@TkTech done!

sh4nks commented 7 years ago

Thank you very much adding this! Looks like I can abandon my fork.