Skip to content

Commit 269fd31

Browse files
docs: add TRANSLATORS comments for mustache variables
Add explicit comments warning translators not to translate mustache template variables ({{variableName}}) in signature text strings. This prevents corruption of template syntax during localization. Discovered during investigation of #6961 where French translation had corrupted mustache braces. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 3aa736e commit 269fd31

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

lib/Service/SignatureTextService.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,21 @@ private function mbWordwrap(string $text, int $width, string $break = "\n", bool
388388
public function getDefaultTemplate(): string {
389389
$collectMetadata = $this->appConfig->getValueBool(Application::APP_ID, 'collect_metadata', false);
390390
if ($collectMetadata) {
391+
// TRANSLATORS Variables enclosed in double curly braces {{variableName}} are template placeholders.
392+
//
393+
// DO NOT translate or remove these variables:
394+
// - {{SignerCommonName}}
395+
// - {{IssuerCommonName}}
396+
// - {{ServerSignatureDate}}
397+
// - {{SignerIP}}
398+
// - {{SignerUserAgent}}
399+
//
400+
// Only translate the text outside the curly braces, such as:
401+
// - "Signed with LibreSign"
402+
// - "Issuer:"
403+
// - "Date:"
404+
// - "IP:"
405+
// - "User agent:"
391406
return $this->l10n->t(
392407
"Signed with LibreSign\n"
393408
. "{{SignerCommonName}}\n"
@@ -397,6 +412,17 @@ public function getDefaultTemplate(): string {
397412
. 'User agent: {{SignerUserAgent}}'
398413
);
399414
}
415+
// TRANSLATORS Variables enclosed in double curly braces {{variableName}} are template placeholders.
416+
//
417+
// DO NOT translate or remove these variables:
418+
// - {{SignerCommonName}}
419+
// - {{IssuerCommonName}}
420+
// - {{ServerSignatureDate}}
421+
//
422+
// Only translate the text outside the curly braces, such as:
423+
// - "Signed with LibreSign"
424+
// - "Issuer:"
425+
// - "Date:"
400426
return $this->l10n->t(
401427
"Signed with LibreSign\n"
402428
. "{{SignerCommonName}}\n"

0 commit comments

Comments
 (0)