Skip to content

Commit

Permalink
[Editor] Fix l10n issues
Browse files Browse the repository at this point in the history
Remove the strings containing only a variable.
  • Loading branch information
calixteman committed Aug 2, 2024
1 parent 501da85 commit 37f091b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions l10n/en-US/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion web/new_alt_text_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}}`
`{"totalSize": ${totalSize}, "downloadedSize": ${downloadedSize}}`
);
if (!finished) {
return;
Expand Down
2 changes: 1 addition & 1 deletion web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
<label for="newAltTextCreateAutomaticallyButton" class="togglerLabel" data-l10n-id="pdfjs-editor-new-alt-text-create-automatically-button-label">Create alt text automatically</label>
</div>
<div id="newAltTextDownloadModel" class="hidden">
<span id="newAltTextDownloadModelDescription" data-l10n-id="pdfjs-editor-new-alt-text-ai-model-downloading-progress" data-l10n-args='{ "totalSize": 0, "downloadedSize": 0 }'>Downloading alt text AI model (0 of 0 MB)</span>
<span id="newAltTextDownloadModelDescription" data-l10n-id="pdfjs-editor-new-alt-text-ai-model-downloading-progress" aria-valuemin="0" data-l10n-args='{ "totalSize": 0, "downloadedSize": 0 }'>Downloading alt text AI model (0 of 0 MB)</span>
</div>
</div>
<div id="newAltTextImagePreview"></div>
Expand Down

0 comments on commit 37f091b

Please sign in to comment.