Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion weblate/static/js/account-security.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ document.querySelectorAll("[data-security-progress]").forEach((container) => {
bar.setAttribute("aria-valuenow", result.progress);
bar.textContent = `${result.progress}%`;
count.textContent = interpolate(
gettext("Processed %(processed)s of %(total)s entries."),
ngettext(
"Processed %(processed)s of %(total)s entry.",
"Processed %(processed)s of %(total)s entries.",
result,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the total count to ngettext

result is the entire JSON response object, but the third argument to ngettext() must be the numeric count used to select the plural form. Passing an object causes plural rules to evaluate against a nonnumeric value, so a single-entry operation still displays “1 entries” in English and other languages can select incorrect forms as well. Pass result.total here, while retaining result as the interpolation mapping.

Useful? React with 👍 / 👎.

Comment thread
nijel marked this conversation as resolved.
Resolved
),
result,
true,
);
Expand Down
Loading