Port flask-babelex features to flask-babel#163
Merged
Conversation
Use pytest as framework for testing. Sort tests into different files for better overview.
Contributor
|
This looks good, I will try this branch with flask-admin. Re: credits - I'm fine either way. |
Co-authored-by: Lea Tschiersch <lea.tschiersch@cern.ch> Co-authored-by: Serge S. Koval <serge.koval+github@gmail.com>
Like this moving from flask-babelex is easier, and the most common case is more convenient.
c1f3493 to
0bf48df
Compare
Contributor
|
I hope to have time to review this on the weekend. Do you expect to push any more changes? |
Contributor
Author
|
Sorry, I only noticed the second part of your comment now since there are no notifications about comments being edited. No plans to push more unless you insist on us updating the docs of course... PS: Could you credit the flask-babelex author for originally contributing those features in whatever way you find most suitable when merging this? |
|
Any update on this? |
Closed
amercader
added a commit
to amercader/flask-babel
that referenced
this pull request
Mar 18, 2022
Adds support for loading translations from different domains in the same Flask-Babel instance. After the refactor in python-babel#163 there was no longer support for defining multiple translation domains for different translation directories. When loading the translations, a single domain was always used: 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 to `BABEL_TRANSLATION_DIRECTORIES`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: We have NOT tested it with any projects using the currently-released flask-babel version yet (so if anyone has such a project, doing so would be great). But the tests pass! ;)
@mrjoes do you want to be listed as a co-author in the commit that contains most of your babelex changes and/or somewhere in the copyright header? (if it's the latter, feel free to push a commit somewhere and we'll cherry-pick it into this PR)