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:
Goffi 2021-06-14 18:35:12 +02:00
commit 7adbf3ead8

View file

@ -73,7 +73,9 @@ class AccountCreate(base.CommandBase):
"--port",
type=int,
default=0,
help=_(f"server port (default: {C.XMPP_C2S_PORT})"),
help=_("server port (default: {port})").format(
port=C.XMPP_C2S_PORT
),
)
async def start(self):
@ -124,8 +126,12 @@ class AccountCreate(base.CommandBase):
self.host.quit(C.EXIT_CONFLICT)
else:
self.disp(
_(f"Can't create profile {self.args.profile} to associate with jid "
f"{self.args.jid}: {e}"),
_("Can't create profile {profile} to associate with jid "
"{jid}: {e}").format(
profile=self.args.profile,
jid=self.args.jid,
e=e
),
error=True,
)
self.host.quit(C.EXIT_BRIDGE_ERRBACK)