Allow translating argument error messages (#17169)

This commit is contained in:
DjMorgul 2022-05-05 07:32:49 +02:00 committed by GitHub
parent a918589578
commit b885b8f4be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -766,7 +766,7 @@ class ArgumentError(Exception):
if self.argument_name is None:
format = '%(message)s'
else:
format = 'argument %(argument_name)s: %(message)s'
format = _('argument %(argument_name)s: %(message)s')
return format % dict(message=self.message,
argument_name=self.argument_name)