[Editor] Fix the button labels in the comment dialog (bug 1990499)

This commit is contained in:
Calixte Denizet 2025-09-24 18:18:43 +02:00
parent 83b5e9efb0
commit 7b67ed3454
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

@ -681,12 +681,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>