diff sat/plugins/plugin_import.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/plugins/plugin_import.py	Mon Jun 14 12:19:21 2021 +0200
+++ b/sat/plugins/plugin_import.py	Mon Jun 14 18:35:12 2021 +0200
@@ -64,7 +64,7 @@
         @param name(unicode): import handler name
         """
         assert name == name.lower().strip()
-        log.info(_(f"initializing {name} import handler"))
+        log.info(_("initializing {name} import handler").format(name=name))
         import_handler.name = name
         import_handler.register = partial(self.register, import_handler)
         import_handler.unregister = partial(self.unregister, import_handler)
@@ -155,7 +155,7 @@
                 pass
             except ValueError:
                 raise exceptions.DataError(
-                    _(f"invalid json option: {option}")
+                    _("invalid json option: {option}").format(option=option)
                 )
         pubsub_service = jid.JID(pubsub_service) if pubsub_service else None
         return self.doImport(