Skip to content

Commit 7b67ed3

Browse files
committed
[Editor] Fix the button labels in the comment dialog (bug 1990499)
1 parent 83b5e9e commit 7b67ed3

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
@@ -681,12 +681,25 @@ class CommentDialog {
681681
this.#commentText = str || "";
682682
const textInput = this.#textInput;
683683
textInput.value = this.#previousText = this.#commentText;
684-
this.#title.setAttribute(
685-
"data-l10n-id",
686-
str
687-
? "pdfjs-editor-edit-comment-dialog-title-when-editing"
688-
: "pdfjs-editor-edit-comment-dialog-title-when-adding"
689-
);
684+
if (str) {
685+
this.#title.setAttribute(
686+
"data-l10n-id",
687+
"pdfjs-editor-edit-comment-dialog-title-when-editing"
688+
);
689+
this.#saveButton.setAttribute(
690+
"data-l10n-id",
691+
"pdfjs-editor-edit-comment-dialog-save-button-when-editing"
692+
);
693+
} else {
694+
this.#title.setAttribute(
695+
"data-l10n-id",
696+
"pdfjs-editor-edit-comment-dialog-title-when-adding"
697+
);
698+
this.#saveButton.setAttribute(
699+
"data-l10n-id",
700+
"pdfjs-editor-edit-comment-dialog-save-button-when-adding"
701+
);
702+
}
690703
if (options?.height) {
691704
textInput.style.height = `${options.height}px`;
692705
}

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)