File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class DrawingEditor extends AnnotationEditor {
113113 this . #drawOutlines = drawOutlines ;
114114 this . _drawingOptions ||= drawingOptions ;
115115 if ( ! this . annotationElementId ) {
116- this . _uiManager . a11yAlert ( `pdfjs-editor- ${ this . editorType } -added-alert` ) ;
116+ this . _uiManager . a11yAlert ( AnnotationEditor . _l10nAlert [ this . editorType ] ) ;
117117 }
118118
119119 if ( drawId >= 0 ) {
Original file line number Diff line number Diff line change @@ -109,6 +109,8 @@ class AnnotationEditor {
109109
110110 static _l10n = null ;
111111
112+ static _l10nAlert = null ;
113+
112114 static _l10nResizer = null ;
113115
114116 #isDraggable = false ;
@@ -247,7 +249,15 @@ class AnnotationEditor {
247249 static initialize ( l10n , _uiManager ) {
248250 AnnotationEditor . _l10n ??= l10n ;
249251
250- AnnotationEditor . _l10nResizer ||= Object . freeze ( {
252+ AnnotationEditor . _l10nAlert ??= Object . freeze ( {
253+ highlight : "pdfjs-editor-highlight-added-alert" ,
254+ freetext : "pdfjs-editor-freetext-added-alert" ,
255+ ink : "pdfjs-editor-ink-added-alert" ,
256+ stamp : "pdfjs-editor-stamp-added-alert" ,
257+ signature : "pdfjs-editor-signature-added-alert" ,
258+ } ) ;
259+
260+ AnnotationEditor . _l10nResizer ??= Object . freeze ( {
251261 topLeft : "pdfjs-editor-resizer-top-left" ,
252262 topMiddle : "pdfjs-editor-resizer-top-middle" ,
253263 topRight : "pdfjs-editor-resizer-top-right" ,
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ class FreeTextEditor extends AnnotationEditor {
133133 AnnotationEditor . _defaultLineColor ;
134134 this . #fontSize = params . fontSize || FreeTextEditor . _defaultFontSize ;
135135 if ( ! this . annotationElementId ) {
136- this . _uiManager . a11yAlert ( "pdfjs-editor- freetext-added-alert" ) ;
136+ this . _uiManager . a11yAlert ( AnnotationEditor . _l10nAlert . freetext ) ;
137137 }
138138 this . canAddComment = false ;
139139 }
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ class HighlightEditor extends AnnotationEditor {
128128 }
129129
130130 if ( ! this . annotationElementId ) {
131- this . _uiManager . a11yAlert ( "pdfjs-editor- highlight-added-alert" ) ;
131+ this . _uiManager . a11yAlert ( AnnotationEditor . _l10nAlert . highlight ) ;
132132 }
133133 }
134134
Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ class StampEditor extends AnnotationEditor {
483483 this . div . setAttribute ( "aria-description" , this . #bitmapFileName) ;
484484 }
485485 if ( ! this . annotationElementId ) {
486- this . _uiManager . a11yAlert ( "pdfjs-editor- stamp-added-alert" ) ;
486+ this . _uiManager . a11yAlert ( AnnotationEditor . _l10nAlert . stamp ) ;
487487 }
488488 }
489489
You can’t perform that action at this time.
0 commit comments