flask-security icon indicating copy to clipboard operation
flask-security copied to clipboard

Switch to Flask-Babel?

Open dappiu opened this issue 7 years ago • 8 comments

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

dappiu avatar Oct 06 '17 09:10 dappiu

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.

df7cb avatar Dec 05 '17 14:12 df7cb

@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.

jirikuncar avatar Dec 06 '17 08:12 jirikuncar

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

rnd0101 avatar Dec 23 '17 18:12 rnd0101

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.

italomaia avatar Jan 30 '18 17:01 italomaia

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

TimotheeJeannin avatar Apr 26 '18 15:04 TimotheeJeannin

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.

TaaviE avatar Dec 01 '18 21:12 TaaviE

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.

galeo avatar Dec 24 '18 06:12 galeo

@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.

jwag956 avatar Jun 14 '19 17:06 jwag956