core, frontends: fix invalid translatable strings.
Some f-strings where used in translatable text, this has been fixed by using explicit `format()` call (using a script based on `tokenize`). As tokenize messes with spaces, a reformating tool (`black`) has been applied to some files afterwards.
This commit is contained in:
parent
8d8541015c
commit
7adbf3ead8
1 changed files with 823 additions and 601 deletions
|
|
@ -972,8 +972,12 @@ class Params(object):
|
|||
|
||||
if not self.checkSecurityLimit(node[1], security_limit):
|
||||
msg = _(
|
||||
f"{profile!r} is trying to set parameter {name!r} in category "
|
||||
f"{category!r} without authorization!!!")
|
||||
"{profile!r} is trying to set parameter {name!r} in category "
|
||||
"{category!r} without authorization!!!").format(
|
||||
profile=repr(profile),
|
||||
name=repr(name),
|
||||
category=repr(category)
|
||||
)
|
||||
log.warning(msg)
|
||||
raise exceptions.PermissionError(msg)
|
||||
|
||||
|
|
@ -986,8 +990,11 @@ class Params(object):
|
|||
int(value)
|
||||
except ValueError:
|
||||
log.warning(_(
|
||||
f"Trying to set parameter {name!r} in category {category!r} with"
|
||||
f"an non-integer value"
|
||||
"Trying to set parameter {name} in category {category} with"
|
||||
"an non-integer value"
|
||||
).format(
|
||||
name=repr(name),
|
||||
category=repr(category)
|
||||
))
|
||||
return defer.succeed(None)
|
||||
if node[1].hasAttribute("constraint"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue