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 # An existing comment is edited
pdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment pdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment
pdfjs-editor-edit-comment-dialog-save-button-when-editing = Update
# No existing comment # No existing comment
pdfjs-editor-edit-comment-dialog-title-when-adding = Add 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 = pdfjs-editor-edit-comment-dialog-text-input =
.placeholder = Start typing… .placeholder = Start typing…
pdfjs-editor-edit-comment-dialog-cancel-button = Cancel pdfjs-editor-edit-comment-dialog-cancel-button = Cancel
pdfjs-editor-edit-comment-dialog-save-button = Save
## Edit a comment button in the editor toolbar ## Edit a comment button in the editor toolbar

View File

@ -682,12 +682,25 @@ class CommentDialog {
this.#commentText = str || ""; this.#commentText = str || "";
const textInput = this.#textInput; const textInput = this.#textInput;
textInput.value = this.#previousText = this.#commentText; textInput.value = this.#previousText = this.#commentText;
this.#title.setAttribute( if (str) {
"data-l10n-id", this.#title.setAttribute(
str "data-l10n-id",
? "pdfjs-editor-edit-comment-dialog-title-when-editing" "pdfjs-editor-edit-comment-dialog-title-when-editing"
: "pdfjs-editor-edit-comment-dialog-title-when-adding" );
); 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) { if (options?.height) {
textInput.style.height = `${options.height}px`; 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> <span data-l10n-id="pdfjs-editor-edit-comment-dialog-cancel-button"></span>
</button> </button>
<button id="commentManagerSaveButton" type="button" class="primaryButton" disabled tabindex="0"> <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> </button>
</div> </div>
</div> </div>