Skip to content

Commit 8448d08

Browse files
authored
Merge pull request #20300 from calixteman/bug1990499
[Editor] Fix the button labels in the comment dialog (bug 1990499)
2 parents a8cf9a4 + 7b67ed3 commit 8448d08

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

l10n/en-US/viewer.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,15 +684,16 @@ pdfjs-editor-delete-comment-popup-button =
684684

685685
# An existing comment is edited
686686
pdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment
687+
pdfjs-editor-edit-comment-dialog-save-button-when-editing = Update
687688
688689
# No existing comment
689690
pdfjs-editor-edit-comment-dialog-title-when-adding = Add comment
691+
pdfjs-editor-edit-comment-dialog-save-button-when-adding = Add
690692
691693
pdfjs-editor-edit-comment-dialog-text-input =
692694
.placeholder = Start typing…
693695
694696
pdfjs-editor-edit-comment-dialog-cancel-button = Cancel
695-
pdfjs-editor-edit-comment-dialog-save-button = Save
696697
697698
## Edit a comment button in the editor toolbar
698699

web/comment_manager.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,12 +682,25 @@ class CommentDialog {
682682
this.#commentText = str || "";
683683
const textInput = this.#textInput;
684684
textInput.value = this.#previousText = this.#commentText;
685-
this.#title.setAttribute(
686-
"data-l10n-id",
687-
str
688-
? "pdfjs-editor-edit-comment-dialog-title-when-editing"
689-
: "pdfjs-editor-edit-comment-dialog-title-when-adding"
690-
);
685+
if (str) {
686+
this.#title.setAttribute(
687+
"data-l10n-id",
688+
"pdfjs-editor-edit-comment-dialog-title-when-editing"
689+
);
690+
this.#saveButton.setAttribute(
691+
"data-l10n-id",
692+
"pdfjs-editor-edit-comment-dialog-save-button-when-editing"
693+
);
694+
} else {
695+
this.#title.setAttribute(
696+
"data-l10n-id",
697+
"pdfjs-editor-edit-comment-dialog-title-when-adding"
698+
);
699+
this.#saveButton.setAttribute(
700+
"data-l10n-id",
701+
"pdfjs-editor-edit-comment-dialog-save-button-when-adding"
702+
);
703+
}
691704
if (options?.height) {
692705
textInput.style.height = `${options.height}px`;
693706
}

web/viewer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@
803803
<span data-l10n-id="pdfjs-editor-edit-comment-dialog-cancel-button"></span>
804804
</button>
805805
<button id="commentManagerSaveButton" type="button" class="primaryButton" disabled tabindex="0">
806-
<span data-l10n-id="pdfjs-editor-edit-comment-dialog-save-button"></span>
806+
<span data-l10n-id="pdfjs-editor-edit-comment-dialog-save-button-when-adding"></span>
807807
</button>
808808
</div>
809809
</div>

0 commit comments

Comments
 (0)