diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties index 3c4e43b45..f25d4e280 100644 --- a/l10n/en-US/viewer.properties +++ b/l10n/en-US/viewer.properties @@ -268,6 +268,7 @@ editor_ink_canvas_aria_label=User-created image # LOCALIZATION NOTE (editor_alt_text_button_label): Alternative text (alt text) helps # when people can't see the image. editor_alt_text_button_label=Alt text +editor_alt_text_edit_button_label=Edit alt text editor_alt_text_dialog_label=Choose an option editor_alt_text_dialog_description=Alt text (alternative text) helps when people can’t see the image or when it doesn’t load. editor_alt_text_add_description_label=Add a description diff --git a/src/display/editor/editor.js b/src/display/editor/editor.js index 959d33ed4..c8b54e015 100644 --- a/src/display/editor/editor.js +++ b/src/display/editor/editor.js @@ -150,6 +150,7 @@ class AnnotationEditor { AnnotationEditor._l10nPromise ||= new Map( [ "editor_alt_text_button_label", + "editor_alt_text_edit_button_label", "editor_alt_text_decorative_tooltip", ].map(str => [str, l10n.get(str)]) ); @@ -831,6 +832,7 @@ class AnnotationEditor { .get("editor_alt_text_button_label") .then(msg => { altText.textContent = msg; + altText.setAttribute("aria-label", msg); }); altText.tabIndex = "0"; altText.addEventListener( @@ -865,6 +867,12 @@ class AnnotationEditor { if (!button || (!this.#altTextDecorative && !this.#altText)) { return; } + AnnotationEditor._l10nPromise + .get("editor_alt_text_edit_button_label") + .then(msg => { + button.setAttribute("aria-label", msg); + }); + let tooltip = this.#altTextTooltip; if (!tooltip) { this.#altTextTooltip = tooltip = document.createElement("span"); diff --git a/web/l10n_utils.js b/web/l10n_utils.js index d83e94ff3..097a02221 100644 --- a/web/l10n_utils.js +++ b/web/l10n_utils.js @@ -83,6 +83,7 @@ const DEFAULT_L10N_STRINGS = { editor_ink2_aria_label: "Draw Editor", editor_ink_canvas_aria_label: "User-created image", editor_alt_text_button_label: "Alt text", + editor_alt_text_edit_button_label: "Edit alt text", editor_alt_text_decorative_tooltip: "Marked as decorative", }; if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {