pallets-eco / flask-security-3.0

Quick and simple security for Flask applications
MIT License
1.63k stars 512 forks source link

Switch to Flask-Babel? #715

Open dappiu opened 7 years ago

dappiu commented 7 years ago

I just want to check what others think about Flask-Babelex...

As of today the two are not API-compatible anymore. Flask-Babelex development seem stuck and Flask-Babel in the recent days got some interesting updates (for example a wrapper for speaklater._LazyString that permits lazy strings to be serialized by Flask's JSON encoder).

I thought I could use Flask-Babel and Flask-Babelex in the same project, but this causes problems because the extension inside Flask is named babel in both cases and this causes one of the two getting overwritten by the other.

Is this problem felt by others too?

Cheers

df7cb commented 6 years ago

I'm co-maintaining the Debian package of flask-security (yet to be uploaded), and babelex is causing headaches because of the issues mentioned by @dappiu. Also, the newly added dependency on speaklater is suboptimal, as we only recently got rid of the python-speaklater package in Debian because it is dead upstream. We (Debian) are sticking with flask-security 1.7.5 for now for these reasons.

jirikuncar commented 6 years ago

@dappiu it should be possible to make the Flask-Babel and Flask-BabelEx interchangeable in Flask-Security. I would be happy to accept a PR.

rnd0101 commented 6 years ago

Same concern here. I guess, Flask-BabelEx is needed for i18n to work correctly as Flask-Babel currently has just one translation domain.

italomaia commented 6 years ago

Maybe patching flask-babel with the missing features than chaning flask-security dependency is the way to go. Longer road, but one hell of a view.

TimotheeJeannin commented 6 years ago

@jirikuncar I think it would be better to use Flask-Babel instead of Flask-Babelex. Flask-Babelex is no longer maintained.

TaaviE commented 5 years ago

Flask-Babelex combined with Flask-Babel used by other projects is really causing super annoying incompatibilities on Python 3.7 across distributions. It would be really appreciated if this dependency is dropped or at least there'd be an option to disable it's use.

galeo commented 5 years ago

Hi @jirikuncar

I have opened a pull request to flask-babel that trying to support multiple translations with different message domains. Is there still a chance to switch from flask-babelex to flask-babel? I'd like to receive your feedback.

jwag956 commented 5 years ago

@galeo I have started a fork for Flask-Security - https://pypi.org/project/Flask-Security-Too/#description and I would love to solve this issue - so if we could get an update of Flask-Babel with Domain support - I would change over immediately.