Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port flask-babelex features to flask-babel #163

Merged
merged 6 commits into from
Aug 26, 2020

Conversation

ThiefMaster
Copy link
Contributor

@ThiefMaster ThiefMaster commented Feb 13, 2020

  • we switched to pytest because running the tests with unittest was a mess
  • also split the tests into separate files, because that one file was already pretty huge
  • added dev dependencies in a setuptools extra (like in werkzeug etc) so they can be easily installed
  • added recent py3 versions in the tox envs
  • domain support and caching are pretty much directly ported from flask-babelex with some changes since flask-babel got multi-directory support in the meantime
  • we did NOT reformat the code, at some point adding black etc like in the pallets projects would probably be a good idea
  • we did not keep support flask-babelex had for using the flask extension without having initialized it. to me that looks very much like supporting something that's not expected to work anyway..
  • TODO: docs

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)

ThiefMaster and others added 2 commits February 12, 2020 16:25
Use pytest as framework for testing.
Sort tests into different files for better overview.
@mrjoes
Copy link
Contributor

mrjoes commented Feb 15, 2020

This looks good, I will try this branch with flask-admin.

Re: credits - I'm fine either way.

ThiefMaster and others added 4 commits February 17, 2020 15:03
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.
@TkTech
Copy link
Contributor

TkTech commented Feb 25, 2020

I hope to have time to review this on the weekend. Do you expect to push any more changes?

@ThiefMaster
Copy link
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?

@mischkadb
Copy link

Any update on this?

@TkTech TkTech merged commit 49aebd9 into python-babel:master Aug 26, 2020
@jwag956 jwag956 mentioned this pull request Aug 31, 2020
@ThiefMaster ThiefMaster deleted the merge-babelex-features branch April 19, 2021 14:19
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants