You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Babel have added decimal_quantization to format_decimal, format_currency, format_percent, and format_scientific. Flask-Babel cannot pass this arg through when using the equivalent proxy functions so users cannot use these new features.
For reference here is Flask-Babel's format_percent
defformat_percent(number, format=None):
"""Return formatted percent value for the locale in request :param number: the number to format :param format: the format to use :return: the formatted percent number :rtype: unicode """locale=get_locale()
returnnumbers.format_percent(number, format=format, locale=locale)
And the signature of the underlying Babel function:
Should Flask-Babel hard code args in like this, or should it use the *args, **kwargs pattern to pass through extra args to the underlying Babel functions?
The text was updated successfully, but these errors were encountered:
A great many of these methods are just dumb wrappers around the babel method, passing the locale and the rest unchanged. I've been contemplating some alternatives to prevent us from having to maintain them. We could reflect all of the flask-babel bindings, checking the signature (inspect.getargspec/inspect.signature) of the babel method to see if it takes a locale kwarg and fetching it if so.
Babel have added
decimal_quantization
toformat_decimal
,format_currency
,format_percent
, andformat_scientific
. Flask-Babel cannot pass this arg through when using the equivalent proxy functions so users cannot use these new features.For reference here is Flask-Babel's
format_percent
And the signature of the underlying Babel function:
Should Flask-Babel hard code args in like this, or should it use the
*args, **kwargs
pattern to pass through extra args to the underlying Babel functions?The text was updated successfully, but these errors were encountered: