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
|
|
@ -107,9 +107,7 @@ class EventBase(object):
|
|||
default="",
|
||||
help=_("ID of the PubSub Item"),
|
||||
)
|
||||
self.parser.add_argument(
|
||||
"-d", "--date", type=str, help=_("date of the event")
|
||||
)
|
||||
self.parser.add_argument("-d", "--date", type=str, help=_("date of the event"))
|
||||
self.parser.add_argument(
|
||||
"-f",
|
||||
"--field",
|
||||
|
|
@ -169,7 +167,7 @@ class Create(EventBase, base.CommandBase):
|
|||
self.disp(f"can't create event: {e}", error=True)
|
||||
self.host.quit(C.EXIT_BRIDGE_ERRBACK)
|
||||
else:
|
||||
self.disp(_(f"Event created successfuly on node {node}"))
|
||||
self.disp(_("Event created successfuly on node {node}").format(node=node))
|
||||
self.host.quit()
|
||||
|
||||
|
||||
|
|
@ -350,9 +348,7 @@ class InviteesList(base.CommandBase):
|
|||
table = common.Table.fromListDict(
|
||||
self.host,
|
||||
data,
|
||||
("nick",)
|
||||
+ (("jid",) if self.host.verbosity else ())
|
||||
+ ("attend", "guests"),
|
||||
("nick",) + (("jid",) if self.host.verbosity else ()) + ("attend", "guests"),
|
||||
headers=None,
|
||||
filters={
|
||||
"nick": A.color(C.A_HEADER, "{}" if show_table else "{} "),
|
||||
|
|
@ -402,9 +398,7 @@ class InviteesList(base.CommandBase):
|
|||
)
|
||||
)
|
||||
self.disp(
|
||||
A.color(
|
||||
C.A_SUBHEADER, _("total: "), A.RESET, str(guests + guests_maybe)
|
||||
)
|
||||
A.color(C.A_SUBHEADER, _("total: "), A.RESET, str(guests + guests_maybe))
|
||||
)
|
||||
if attendees_missing:
|
||||
self.disp("")
|
||||
|
|
@ -453,7 +447,7 @@ class InviteesList(base.CommandBase):
|
|||
self.disp(f"can't get event data: {e}", error=True)
|
||||
self.host.quit(C.EXIT_BRIDGE_ERRBACK)
|
||||
|
||||
# we fill nicknames and keep only requested people
|
||||
# we fill nicknames and keep only requested people
|
||||
|
||||
if self.args.no_rsvp:
|
||||
for jid_ in event_data:
|
||||
|
|
@ -462,21 +456,23 @@ class InviteesList(base.CommandBase):
|
|||
try:
|
||||
del prefilled[jid_]
|
||||
except KeyError:
|
||||
self.disp(A.color(
|
||||
C.A_WARNING,
|
||||
f"We got a RSVP from somebody who was not in invitees "
|
||||
f"list: {jid_}"
|
||||
self.disp(
|
||||
A.color(
|
||||
C.A_WARNING,
|
||||
f"We got a RSVP from somebody who was not in invitees "
|
||||
f"list: {jid_}",
|
||||
),
|
||||
error=True)
|
||||
error=True,
|
||||
)
|
||||
else:
|
||||
# we replace empty dicts for existing people with R.S.V.P. data
|
||||
prefilled.update(event_data)
|
||||
|
||||
# we get nicknames for everybody, make it easier for organisers
|
||||
# we get nicknames for everybody, make it easier for organisers
|
||||
for jid_, data in prefilled.items():
|
||||
id_data = await self.host.bridge.identityGet(jid_, [], True, self.profile)
|
||||
id_data = data_format.deserialise(id_data)
|
||||
data["nick"] = id_data['nicknames'][0]
|
||||
data["nick"] = id_data["nicknames"][0]
|
||||
|
||||
await self.output(prefilled)
|
||||
self.host.quit()
|
||||
|
|
|
|||
Loading…
Reference in a new issue