From 8f94317e80e367f5b955178c41a73b2091f38331 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 16 Feb 2026 17:33:43 +0100 Subject: [PATCH] Support localization for annotation labels and text Replaced hardcoded annotation labels and text with localized values, falling back to English defaults if not available. Date formatting now adapts to the current locale using getCurrentCulture(). --- EnvelopeGenerator.Web/wwwroot/js/annotation.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index 919d2fd4..55b53758 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -112,7 +112,7 @@ async function createAnnotations(document, envelopeId, receiverId) { const formFieldDateLabel = new PSPDFKit.FormFields.TextFormField({ name: id_date_label, annotationIds: PSPDFKit.Immutable.List([annotation_date_label.id]), - value: "Date", + value: localized.date ?? "Date", readOnly: true }) //#endregion @@ -134,7 +134,7 @@ async function createAnnotations(document, envelopeId, receiverId) { const formFieldCityLabel = new PSPDFKit.FormFields.TextFormField({ name: id_city_label, annotationIds: PSPDFKit.Immutable.List([annotation_city_label.id]), - value: "Ort", + value: localized.city ?? "City", readOnly: true, color: PSPDFKit.Color.BLACK }) @@ -157,7 +157,7 @@ async function createAnnotations(document, envelopeId, receiverId) { const formFieldPositionLabel = new PSPDFKit.FormFields.TextFormField({ name: id_position_label, annotationIds: PSPDFKit.Immutable.List([annotation_position_label.id]), - value: "Position", + value: localized.position ?? "Position", readOnly: true }) //#endregion @@ -251,7 +251,7 @@ async function createAnnotationFrameBlob(receiverName, receiverSignature, timest ctx.textRendering = "geometricPrecision" const date = timestamp - const dateString = date.toLocaleString('de-DE') + const dateString = date.toLocaleString(getCurrentCulture()) const signatureLength = 100 * scale const signatureString = receiverSignature.substring(0, 15) + "…" @@ -275,7 +275,7 @@ async function createAnnotationFrameBlob(receiverName, receiverSignature, timest ctx.fillStyle = 'black' ctx.font = `${fontSize * scale}px sans-serif` - ctx.fillText('Signed by', 15 * scale, 10 * scale) + ctx.fillText(localized.signedBy ?? 'Signed by', 15 * scale, 10 * scale) ctx.fillText(receiverName, 15 * scale, 60 * scale) ctx.fillText(signatureString, 15 * scale, 70 * scale)