Flask-Middleware / flask-security

Quick and simple security for Flask applications
MIT License
624 stars 155 forks source link

Improve support for 2FA and unified signin method localizations. #889

Closed jwag956 closed 7 months ago

jwag956 commented 7 months ago

Improve on recent PR that adds support for 2FA method translations - it didn't actually call a localize_callback to translate the data.

Add tests to verify actual xlation is occurring.

Remove support for Flask-BabelEx.

Use Babel.format_lists to construct the list of existing setup unified signup methods - moving this from the template to the view.

Fix view_scaffold localization configuration.

@gissimo When I wrote some tests - I (re) learned that in Flask-Security '_' is just a marker for strings to translate - it doesn't actually do any translation - so minor change to fix that.

unified signin has very similar 'methods' - so combined that with what you did. Minor wording changes - let me know of any concerns.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (3018dde) 98.33% compared to head (164452c) 98.29%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #889 +/- ## ========================================== - Coverage 98.33% 98.29% -0.05% ========================================== Files 34 34 Lines 4453 4465 +12 ========================================== + Hits 4379 4389 +10 - Misses 74 76 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gissimo commented 6 months ago

Great, thanks and sorry for the drawback. I will update translation strings accordingly.