From bcb01e5e2b8d80927f0c9f983fbd6f7e2b85b629 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 24 Oct 2023 13:17:02 +0200 Subject: [PATCH] Tweak the `matchCount` l10n-args handling slightly (PR 17146 follow-up) Given that providing unused parameters in the l10n-args shouldn't be a problem, let's simplify the relevant JavaScript code a tiny bit. --- web/pdf_find_bar.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/pdf_find_bar.js b/web/pdf_find_bar.js index a2b0f5477..ebdd817fb 100644 --- a/web/pdf_find_bar.js +++ b/web/pdf_find_bar.js @@ -144,16 +144,15 @@ class PDFFindBar { const { findResultsCount } = this; if (total > 0) { - const limit = MATCHES_COUNT_LIMIT, - isLimited = total > limit; + const limit = MATCHES_COUNT_LIMIT; findResultsCount.setAttribute( "data-l10n-id", - `pdfjs-find-match-count${isLimited ? "-limit" : ""}` + `pdfjs-find-match-count${total > limit ? "-limit" : ""}` ); findResultsCount.setAttribute( "data-l10n-args", - JSON.stringify(isLimited ? { limit } : { current, total }) + JSON.stringify({ limit, current, total }) ); } else { findResultsCount.removeAttribute("data-l10n-id");