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

fixed error caused by the fallback implementation of gettext #805

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

LeXofLeviafan
Copy link
Collaborator

…I have no idea how I've missed this, but apparently the fallback gettext() implementation from flask-admin causes an error when using parameters in a template 😅

@@ -4,7 +4,8 @@
except ImportError:
from flask_babel import gettext, ngettext, pgettext, lazy_gettext, lazy_pgettext, LazyString
except ImportError:
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.babel import gettext as _gettext, ngettext, lazy_gettext
gettext = lambda s, *a, **kw: (s if not kw else _gettext(s, *a, **kw))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeXofLeviafan
Copy link
Collaborator Author

I've also made a pull-request to flask-admin, but that fix won't be available until they (finally) make a release 😅

@jarun jarun merged commit 2bd94b1 into jarun:master Jan 2, 2025
1 check passed
@jarun
Copy link
Owner

jarun commented Jan 2, 2025

Thank you!

@LeXofLeviafan LeXofLeviafan deleted the fix-gettext-error branch January 2, 2025 12:57
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.

2 participants