diff 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
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_account.py	Mon Jun 14 12:19:21 2021 +0200
+++ b/sat_frontends/jp/cmd_account.py	Mon Jun 14 18:35:12 2021 +0200
@@ -73,7 +73,9 @@
             "--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 @@
                 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)