comparison sat_frontends/jp/cmd_account.py @ 3568:04283582966f

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.
author Goffi <goffi@goffi.org>
date Mon, 14 Jun 2021 18:35:12 +0200
parents be6d91572633
children 524856bd7b19
comparison
equal deleted inserted replaced
3567:a240748ed686 3568:04283582966f
71 self.parser.add_argument( 71 self.parser.add_argument(
72 "-P", 72 "-P",
73 "--port", 73 "--port",
74 type=int, 74 type=int,
75 default=0, 75 default=0,
76 help=_(f"server port (default: {C.XMPP_C2S_PORT})"), 76 help=_("server port (default: {port})").format(
77 port=C.XMPP_C2S_PORT
78 ),
77 ) 79 )
78 80
79 async def start(self): 81 async def start(self):
80 try: 82 try:
81 await self.host.bridge.inBandAccountNew( 83 await self.host.bridge.inBandAccountNew(
122 error=True 124 error=True
123 ) 125 )
124 self.host.quit(C.EXIT_CONFLICT) 126 self.host.quit(C.EXIT_CONFLICT)
125 else: 127 else:
126 self.disp( 128 self.disp(
127 _(f"Can't create profile {self.args.profile} to associate with jid " 129 _("Can't create profile {profile} to associate with jid "
128 f"{self.args.jid}: {e}"), 130 "{jid}: {e}").format(
131 profile=self.args.profile,
132 jid=self.args.jid,
133 e=e
134 ),
129 error=True, 135 error=True,
130 ) 136 )
131 self.host.quit(C.EXIT_BRIDGE_ERRBACK) 137 self.host.quit(C.EXIT_BRIDGE_ERRBACK)
132 except Exception as e: 138 except Exception as e:
133 self.disp(f"Internal error: {e}", error=True) 139 self.disp(f"Internal error: {e}", error=True)