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
from pydal import validators
from py4web import Translator
# T = Translator("soccer/translations")
# T.select("es")
T = Translator()
# default error message works fine
r = validators.range_error_message(None, what_to_enter = "a number", minimum=1, maximum=8)
print(r)
# string works fine
r = validators.range_error_message("Hello", what_to_enter = "a number", minimum=1, maximum=8)
print(r)
# use of translator fails
# TypeError: unsupported operand type(s) for %: 'lazyT' and 'dict'
r = validators.range_error_message(T("Hello"), what_to_enter = "a number", minimum=1, maximum=8)
print(r)
I believe the code: return translate(error_message) % dict(min=minimum, max=maximum)
should be replaced with return str(translate(error_message)) % dict(min=minimum, max=maximum)
The text was updated successfully, but these errors were encountered:
I believe the code:
return translate(error_message) % dict(min=minimum, max=maximum)
should be replaced with
return str(translate(error_message)) % dict(min=minimum, max=maximum)
The text was updated successfully, but these errors were encountered: