Addon Manager: Translation cleanup

pylupdate does not extract translations when f-strings are used for the
translated text, so all f-strings are migrated to calls to format().
Several other minor translation issues are also addressed.

NOTE: This code has been run through the Black reformatter, which adds
trailing commas in many places that the stock Qt 5.x pylupdate does not
recognize. This code must be processed with the corrected pylupdate to
generate the correct translations.
This commit is contained in:
Chris Hennes
2022-01-27 23:11:31 -06:00
parent d1f30a9d9b
commit c62dc32739
7 changed files with 153 additions and 144 deletions

View File

@@ -171,8 +171,8 @@ class Macro(object):
FreeCAD.Console.PrintWarning(
translate(
"AddonsInstaller",
f"Unable to open macro wiki page at {url}",
)
"Unable to open macro wiki page at {}",
).format(url)
+ "\n"
)
return
@@ -188,8 +188,8 @@ class Macro(object):
FreeCAD.Console.PrintWarning(
translate(
"AddonsInstaller",
f"Unable to open macro code URL {rawcodeurl}",
)
"Unable to open macro code URL {rawcodeurl}",
).format(rawcodeurl)
+ "\n"
)
return
@@ -221,8 +221,8 @@ class Macro(object):
FreeCAD.Console.PrintWarning(
translate(
"AddonsInstaller",
f"Unable to retrieve a description from the wiki for macro {self.name}",
)
"Unable to retrieve a description from the wiki for macro {}",
).format(self.name)
+ "\n"
)
desc = "No description available"
@@ -322,8 +322,8 @@ class Macro(object):
FreeCAD.Console.PrintWarning(
translate(
"AddonsInstaller",
f"Failed to remove macro file '{dst_file}': it might not exist, or its permissions changed",
)
"Failed to remove macro file '{}': it might not exist, or its permissions changed",
).format(dst_file)
+ "\n"
)
return True