-
-
Notifications
You must be signed in to change notification settings - Fork 513
Consider Flask-Babel integration #18
Comments
If anyone has some experience with doing this, I've started a branch named messages. I've having a bit of a hard time getting this feature started. The implementation is based on the Flask-Admin implementation. |
This could be a great feature indeed! 👍 |
Tell me about it. I haven't had much success getting it to work in the way that Flask-Admin has. |
Maybe I can take a shot at it next week - if I can find the time. Not very experienced with Babel, but I would definitively use this feature. Anything I should know beforehand? |
Not that I can think of. Flask-Admin seems to have it figured out, thats about all I have to contribute as of now. |
+1 Unfortunately that doesn't work for _default_field_labels in forms.py. It might work if the definition of the _default_field_labels would be in another file, so it could be modified from the outside before the forms.py is imported. This is hacky and definitely not the best solution. P.S. I use lazy_gettext() so the strings get translated on each access and not just once on initialization (or at least so I think, haven't tested it yet). This way the locale can change and the strings are then translated to the correct language. |
I guess there was no progress on this recently. I will try and work on this in upcoming days. |
In addition to Chris solution - to localize login message security = Security(app, user_datastore)
security.login_manager.localize_callback = lazy_gettext |
@yoursdearboy the Flask-BabelEx has been integrated in #617 (originally from inveniosoftware#33). Please check if it works for you and in case you have a problem open new issue. Thank you! |
i10n and i18n could be necessary for things such as Flash messages.
The text was updated successfully, but these errors were encountered: