Skip to content

Commit acd4776

Browse files
committed
docs: add translator guidance for validation reasons
Signed-off-by: Vitor Mattos <[email protected]>
1 parent ae88711 commit acd4776

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/Service/Signature/PdfSignatureValidationService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ private function translateKnownReason(?string $reason): ?string {
245245
}
246246

247247
if (preg_match('/^Intermediate certificate at position (\d+) is not signed by issuer$/', $reason, $matches) === 1) {
248+
// TRANSLATORS: %s is the numeric position of an intermediate certificate in the chain.
248249
return $this->l10n->t(
249250
'Intermediate certificate at position %s is not signed by issuer',
250251
[$matches[1]]
@@ -255,9 +256,12 @@ private function translateKnownReason(?string $reason): ?string {
255256
if (str_starts_with($reason, $prefix)) {
256257
$detail = substr($reason, strlen($prefix));
257258
$translatedDetail = $this->translateKnownReason($detail) ?? $detail;
259+
// TRANSLATORS: %s is a translated certificate validation detail message.
258260
return $this->l10n->t('Certificate validation failed: %s', [$translatedDetail]);
259261
}
260262

263+
// TRANSLATORS: Technical validation reasons from pdf-signature-validator.
264+
// Keep protocol/acronym terms like ByteRange, CRL and CA as-is.
261265
return match ($reason) {
262266
'No ByteRange in signature' => $this->l10n->t('No ByteRange in signature'),
263267
'PDF content hash does not match signed digest' => $this->l10n->t('PDF content hash does not match signed digest'),

0 commit comments

Comments
 (0)