I'm using Flask-Babel for a web application.
In my Jinja2 templates I can do gettext("Number %(number)s", number=1)
. However that doesn't seem to work in Python code. when I do so I get the error TypeError: gettext() got an unexpected keyword argument 'number'
.
I have tried different variations like gettext(f'Number {number}')
and gettext('Number %s') % (number)
. But with no luck. I've tried looking in the documentation, but it's rather limited and they suggest my initial method.
If anybody could help me out that would be great. Thank you.