Merge pull request #20300 from calixteman/bug1990499

[Editor] Fix the button labels in the comment dialog (bug 1990499)
This commit is contained in:
calixteman 2025-09-25 15:29:20 +02:00 committed by GitHub
commit 8448d08345
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 8 deletions

View File

@ -684,15 +684,16 @@ pdfjs-editor-delete-comment-popup-button =
# An existing comment is edited
pdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment
pdfjs-editor-edit-comment-dialog-save-button-when-editing = Update
# No existing comment
pdfjs-editor-edit-comment-dialog-title-when-adding = Add comment
pdfjs-editor-edit-comment-dialog-save-button-when-adding = Add
pdfjs-editor-edit-comment-dialog-text-input =
.placeholder = Start typing…
pdfjs-editor-edit-comment-dialog-cancel-button = Cancel
pdfjs-editor-edit-comment-dialog-save-button = Save
## Edit a comment button in the editor toolbar

View File

@ -682,12 +682,25 @@ class CommentDialog {
this.#commentText = str || "";
const textInput = this.#textInput;
textInput.value = this.#previousText = this.#commentText;
this.#title.setAttribute(
"data-l10n-id",
str
? "pdfjs-editor-edit-comment-dialog-title-when-editing"
: "pdfjs-editor-edit-comment-dialog-title-when-adding"
);
if (str) {
this.#title.setAttribute(
"data-l10n-id",
"pdfjs-editor-edit-comment-dialog-title-when-editing"
);
this.#saveButton.setAttribute(
"data-l10n-id",
"pdfjs-editor-edit-comment-dialog-save-button-when-editing"
);
} else {
this.#title.setAttribute(
"data-l10n-id",
"pdfjs-editor-edit-comment-dialog-title-when-adding"
);
this.#saveButton.setAttribute(
"data-l10n-id",
"pdfjs-editor-edit-comment-dialog-save-button-when-adding"
);
}
if (options?.height) {
textInput.style.height = `${options.height}px`;
}

View File

@ -803,7 +803,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<span data-l10n-id="pdfjs-editor-edit-comment-dialog-cancel-button"></span>
</button>
<button id="commentManagerSaveButton" type="button" class="primaryButton" disabled tabindex="0">
<span data-l10n-id="pdfjs-editor-edit-comment-dialog-save-button"></span>
<span data-l10n-id="pdfjs-editor-edit-comment-dialog-save-button-when-adding"></span>
</button>
</div>
</div>