diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index 49f1ff95d..1165d1e39 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -2823,7 +2823,7 @@ class AnnotationLayer { * @param {AnnotationLayerParameters} params * @memberof AnnotationLayer */ - render(params) { + async render(params) { const { annotations } = params; const layer = this.div; setLayerDimensions(layer, this.viewport); @@ -2897,6 +2897,8 @@ class AnnotationLayer { } this.#setAnnotationCanvasMap(); + + await this.l10n.translate(layer); } /** diff --git a/test/driver.js b/test/driver.js index b2ce75bc5..c42a8bf7b 100644 --- a/test/driver.js +++ b/test/driver.js @@ -235,9 +235,8 @@ class Rasterize { l10n, viewport: annotationViewport, }); - annotationLayer.render(parameters); + await annotationLayer.render(parameters); await annotationLayer.showPopups(); - await l10n.translate(div); // Inline SVG images from text annotations. await inlineImages(div); diff --git a/web/annotation_layer_builder.js b/web/annotation_layer_builder.js index 1edcf6f94..b653a6b0d 100644 --- a/web/annotation_layer_builder.js +++ b/web/annotation_layer_builder.js @@ -134,7 +134,7 @@ class AnnotationLayerBuilder { viewport: viewport.clone({ dontFlip: true }), }); - this.annotationLayer.render({ + await this.annotationLayer.render({ annotations, imageResourcesPath: this.imageResourcesPath, renderForms: this.renderForms, @@ -145,7 +145,6 @@ class AnnotationLayerBuilder { hasJSActions, fieldObjects, }); - this.l10n.translate(div); // Ensure that interactive form elements in the annotationLayer are // disabled while PresentationMode is active (see issue 12232).