Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/display/editor/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DrawingEditor extends AnnotationEditor {
this.#drawOutlines = drawOutlines;
this._drawingOptions ||= drawingOptions;
if (!this.annotationElementId) {
this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`);
this._uiManager.a11yAlert(AnnotationEditor._l10nAlert[this.editorType]);
}

if (drawId >= 0) {
Expand Down
12 changes: 11 additions & 1 deletion src/display/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class AnnotationEditor {

static _l10n = null;

static _l10nAlert = null;

static _l10nResizer = null;

#isDraggable = false;
Expand Down Expand Up @@ -247,7 +249,15 @@ class AnnotationEditor {
static initialize(l10n, _uiManager) {
AnnotationEditor._l10n ??= l10n;

AnnotationEditor._l10nResizer ||= Object.freeze({
AnnotationEditor._l10nAlert ??= Object.freeze({
highlight: "pdfjs-editor-highlight-added-alert",
freetext: "pdfjs-editor-freetext-added-alert",
ink: "pdfjs-editor-ink-added-alert",
stamp: "pdfjs-editor-stamp-added-alert",
signature: "pdfjs-editor-signature-added-alert",
});

AnnotationEditor._l10nResizer ??= Object.freeze({
topLeft: "pdfjs-editor-resizer-top-left",
topMiddle: "pdfjs-editor-resizer-top-middle",
topRight: "pdfjs-editor-resizer-top-right",
Expand Down
2 changes: 1 addition & 1 deletion src/display/editor/freetext.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class FreeTextEditor extends AnnotationEditor {
AnnotationEditor._defaultLineColor;
this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;
if (!this.annotationElementId) {
this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert");
this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.freetext);
}
this.canAddComment = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/display/editor/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class HighlightEditor extends AnnotationEditor {
}

if (!this.annotationElementId) {
this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert");
this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.highlight);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/display/editor/stamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class StampEditor extends AnnotationEditor {
this.div.setAttribute("aria-description", this.#bitmapFileName);
}
if (!this.annotationElementId) {
this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert");
this._uiManager.a11yAlert(AnnotationEditor._l10nAlert.stamp);
}
}

Expand Down
Loading