%(cont)s +about-written-by-damien-elmes-with-patches = Written by Damien Elmes, with patches, translation, testing and design from:
{ $cont }
diff --git a/ftl/qt/addons.ftl b/ftl/qt/addons.ftl
index 89c8588f6..43894125d 100644
--- a/ftl/qt/addons.ftl
+++ b/ftl/qt/addons.ftl
@@ -19,13 +19,13 @@ addons-code = Code:
addons-config = Config
addons-configuration = Configuration
addons-corrupt-addon-file = Corrupt add-on file.
-addons-disabled = (disabled)
+addons-disabled = (disabled)
addons-disabled2 = (disabled)
addons-download-complete-please-restart-anki-to = Download complete. Please restart Anki to apply changes.
-addons-downloaded-fnames = Downloaded %(fname)s
-addons-downloading-adbd-kb02fkb = Downloading %(a)d/%(b)d (%(kb)0.2fKB)...
-addons-error-downloading-ids-errors = Error downloading %(id)s: %(error)s
-addons-error-installing-bases-errors = Error installing %(base)s: %(error)s
+addons-downloaded-fnames = Downloaded { $fname }
+addons-downloading-adbd-kb02fkb = Downloading { $part }/{ $total } ({ $kilobytes }KB)...
+addons-error-downloading-ids-errors = Error downloading { $id }: { $error }
+addons-error-installing-bases-errors = Error installing { $base }: { $error }
addons-get-addons = Get Add-ons...
addons-important-as-addons-are-programs-downloaded = Important: As add-ons are programs downloaded from the internet, they are potentially malicious.You should only install add-ons you trust.
Are you sure you want to proceed with the installation of the following Anki add-on(s)?
%(names)s
addons-install-addon = Install Add-on
@@ -33,12 +33,12 @@ addons-install-addons = Install Add-on(s)
addons-install-anki-addon = Install Anki add-on
addons-install-from-file = Install from file...
addons-installation-complete = Installation complete
-addons-installed-names = Installed %(name)s
+addons-installed-names = Installed { $name }
addons-installed-successfully = Installed successfully.
addons-invalid-addon-manifest = Invalid add-on manifest.
addons-invalid-code = Invalid code.
addons-invalid-code-or-addon-not-available = Invalid code, or add-on not available for your version of Anki.
-addons-invalid-configuration = Invalid configuration:
+addons-invalid-configuration = Invalid configuration:
addons-invalid-configuration-top-level-object-must = Invalid configuration: top level object must be a map
addons-no-updates-available = No updates available.
addons-one-or-more-errors-occurred = One or more errors occurred:
@@ -49,7 +49,7 @@ addons-please-restart-anki-to-complete-the = Please restart Anki to complete
addons-please-select-a-single-addon-first = Please select a single add-on first.
addons-requires = (requires { $val })
addons-restored-defaults = Restored defaults
-addons-the-following-addons-are-incompatible-with = The following add-ons are incompatible with %(name)s and have been disabled: %(found)s
+addons-the-following-addons-are-incompatible-with = The following add-ons are incompatible with { $name } and have been disabled: { $found }
addons-the-following-addons-have-updates-available = The following add-ons have updates available. Install them now?
addons-the-following-conflicting-addons-were-disabled = The following conflicting add-ons were disabled:
addons-this-addon-is-not-compatible-with = This add-on is not compatible with your version of Anki.
@@ -59,7 +59,8 @@ addons-unable-to-update-or-delete-addon = Unable to update or delete add-on. Ple
addons-unknown-error = Unknown error: { $val }
addons-view-addon-page = View Add-on Page
addons-view-files = View Files
-addons-delete-the-numd-selected-addon = { $count ->
- [one] Delete the { $count } selected add-on?
- *[other] Delete the { $count } selected add-ons?
- }
+addons-delete-the-numd-selected-addon =
+ { $count ->
+ [one] Delete the { $count } selected add-on?
+ *[other] Delete the { $count } selected add-ons?
+ }
diff --git a/pylib/anki/importing/csvfile.py b/pylib/anki/importing/csvfile.py
index c76a15295..eeee98d46 100644
--- a/pylib/anki/importing/csvfile.py
+++ b/pylib/anki/importing/csvfile.py
@@ -42,13 +42,11 @@ class TextImporter(NoteImporter):
if row:
log.append(
self.col.tr(
- TR.IMPORTING_ROWS_HAD_NUM1D_FIELDS_EXPECTED_NUM2D
+ TR.IMPORTING_ROWS_HAD_NUM1D_FIELDS_EXPECTED_NUM2D,
+ row=" ".join(row),
+ found=len(row),
+ expected=self.numFields,
)
- % {
- "row": " ".join(row),
- "num1": len(row),
- "num2": self.numFields,
- }
)
ignored += 1
continue
diff --git a/qt/aqt/about.py b/qt/aqt/about.py
index 73205ad85..71eb1591b 100644
--- a/qt/aqt/about.py
+++ b/qt/aqt/about.py
@@ -202,9 +202,9 @@ def show(mw):
)
)
- abouttext += "
" + tr(TR.ABOUT_WRITTEN_BY_DAMIEN_ELMES_WITH_PATCHES) % { - "cont": ", ".join(allusers) - } + abouttext += "
" + tr( + TR.ABOUT_WRITTEN_BY_DAMIEN_ELMES_WITH_PATCHES, cont=", ".join(allusers) + ) abouttext += "
" + tr(TR.ABOUT_IF_YOU_HAVE_CONTRIBUTED_AND_ARE) abouttext += "
" + tr(TR.ABOUT_A_BIG_THANKS_TO_ALL_THE) abt.label.setMinimumWidth(800) diff --git a/qt/aqt/addons.py b/qt/aqt/addons.py index ef8d18912..ab65e5903 100644 --- a/qt/aqt/addons.py +++ b/qt/aqt/addons.py @@ -275,8 +275,11 @@ class AddonManager: if conflicting: addons = ", ".join(self.addonName(f) for f in conflicting) showInfo( - tr(TR.ADDONS_THE_FOLLOWING_ADDONS_ARE_INCOMPATIBLE_WITH) - % dict(name=addon.human_name(), found=addons), + tr( + TR.ADDONS_THE_FOLLOWING_ADDONS_ARE_INCOMPATIBLE_WITH, + name=addon.human_name(), + found=addons, + ), textFormat="plain", ) @@ -306,7 +309,7 @@ class AddonManager: meta = self.addon_meta(dir) name = meta.human_name() if not meta.enabled: - name += tr(TR.ADDONS_DISABLED) + name += " " + tr(TR.ADDONS_DISABLED) return name # Conflict resolution @@ -469,26 +472,24 @@ class AddonManager: result.errmsg, tr(TR.ADDONS_UNKNOWN_ERROR, val=result.errmsg) ) - if mode == "download": # preserve old format strings for i18n - template = tr(TR.ADDONS_ERROR_DOWNLOADING_IDS_ERRORS) + if mode == "download": + template = tr(TR.ADDONS_ERROR_DOWNLOADING_IDS_ERRORS, id=base, error=msg) else: - template = tr(TR.ADDONS_ERROR_INSTALLING_BASES_ERRORS) + template = tr(TR.ADDONS_ERROR_INSTALLING_BASES_ERRORS, base=base, error=msg) - name = base - - return [template % dict(base=name, id=name, error=msg)] + return [template] def _installationSuccessReport( self, result: InstallOk, base: str, mode: str = "download" ) -> List[str]: - if mode == "download": # preserve old format strings for i18n - template = tr(TR.ADDONS_DOWNLOADED_FNAMES) - else: - template = tr(TR.ADDONS_INSTALLED_NAMES) - name = result.name or base - strings = [template % dict(name=name, fname=name)] + if mode == "download": + template = tr(TR.ADDONS_DOWNLOADED_FNAMES, fname=name) + else: + template = tr(TR.ADDONS_INSTALLED_NAMES, name=name) + + strings = [template] if result.conflicts: strings.append( @@ -1074,13 +1075,12 @@ class DownloaderInstaller(QObject): def _progress_callback(self, up: int, down: int) -> None: self.dl_bytes += down self.mgr.mw.progress.update( - # T: "%(a)d" is the index of the element currently - # downloaded. "%(b)d" is the number of element to download, - # and "%(kb)0.2f" is the number of downloaded - # kilobytes. This lead for example to "Downloading 3/5 - # (27KB)" - label=tr(TR.ADDONS_DOWNLOADING_ADBD_KB02FKB) - % dict(a=len(self.log) + 1, b=len(self.ids), kb=self.dl_bytes / 1024) + label=tr( + TR.ADDONS_DOWNLOADING_ADBD_KB02FKB, + part=len(self.log) + 1, + total=len(self.ids), + kilobytes=self.dl_bytes / 1024, + ) ) def _download_all(self) -> None: @@ -1361,7 +1361,7 @@ class ConfigEditor(QDialog): showInfo(msg) return except Exception as e: - showInfo(tr(TR.ADDONS_INVALID_CONFIGURATION) + repr(e)) + showInfo(tr(TR.ADDONS_INVALID_CONFIGURATION) + " " + repr(e)) return if not isinstance(new_conf, dict): diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 967af003c..b43d5b1a2 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -1352,8 +1352,10 @@ QTableView {{ gridline-color: {grid} }} for c, tmpl in enumerate(nt["tmpls"]): # T: name is a card type name. n it's order in the list of card type. # T: this is shown in browser's filter, when seeing the list of card type of a note type. - name = tr(TR.BROWSING_ND_NAMES) % dict( - n=c + 1, name=self._escapeMenuItem(tmpl["name"]) + name = tr( + TR.BROWSING_ND_NAMES, + num=c + 1, + name=self._escapeMenuItem(tmpl["name"]), ) subm.addItem( name, self._filterFunc("note", nt["name"], "card", str(c + 1)) @@ -1995,7 +1997,7 @@ where id in %s""" notes = sum(len(r[1]) for r in res) part1 = tr(TR.BROWSING_GROUP, count=groups) part2 = tr(TR.BROWSING_NOTE_COUNT, count=notes) - t += tr(TR.BROWSING_FOUND_AS_ACROSS_BS) % dict(a=part1, b=part2) + t += tr(TR.BROWSING_FOUND_AS_ACROSS_BS, part=part1, whole=part2) t += "