diff --git a/l10n/en-US/viewer.ftl b/l10n/en-US/viewer.ftl index be2ddedc4a0b0..3c3bed572b394 100644 --- a/l10n/en-US/viewer.ftl +++ b/l10n/en-US/viewer.ftl @@ -447,9 +447,6 @@ pdfjs-editor-new-alt-text-error-close-button = Close # $downloadedSize (Number) - the downloaded size (in MB) of the AI model. # $percent (Number) - the percentage of the downloaded size. pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) - .aria-valuemin = 0 - .aria-valuemax = { $totalSize } - .aria-valuenow = { $downloadedSize } .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) # This is a button that users can click to edit the alt text they have already added. diff --git a/web/new_alt_text_manager.js b/web/new_alt_text_manager.js index 4a5012419f868..1ab2067aa251c 100644 --- a/web/new_alt_text_manager.js +++ b/web/new_alt_text_manager.js @@ -299,9 +299,13 @@ class NewAltTextManager { totalLoaded = Math.min(0.99 * total, totalLoaded); // Update the progress. + const totalSize = (this.#downloadModelDescription.ariaValueMax = + Math.round(total / ONE_MEGA_BYTES)); + const downloadedSize = (this.#downloadModelDescription.ariaValueNow = + Math.round(totalLoaded / ONE_MEGA_BYTES)); this.#downloadModelDescription.setAttribute( "data-l10n-args", - `{"totalSize": ${Math.round(total / ONE_MEGA_BYTES)}, "downloadedSize": ${Math.round(totalLoaded / ONE_MEGA_BYTES)}}` + JSON.stringify({ totalSize, downloadedSize }) ); if (!finished) { return; diff --git a/web/viewer.html b/web/viewer.html index 3bcd43e0b0909..e9162220358f4 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -576,7 +576,7 @@