Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
93.75% |
15 / 16 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SignatureTextTemplate | |
93.75% |
15 / 16 |
|
50.00% |
1 / 2 |
3.00 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| translated | |
100.00% |
15 / 15 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign\Service; |
| 10 | |
| 11 | use OCP\IL10N; |
| 12 | |
| 13 | final class SignatureTextTemplate { |
| 14 | private function __construct() { |
| 15 | } |
| 16 | |
| 17 | public static function translated(IL10N $l10n, bool $collectMetadata): string { |
| 18 | if ($collectMetadata) { |
| 19 | // TRANSLATORS Variables enclosed in double curly braces {{variableName}} are template placeholders. |
| 20 | // |
| 21 | // DO NOT translate or remove these variables: |
| 22 | // - {{SignerCommonName}} |
| 23 | // - {{IssuerCommonName}} |
| 24 | // - {{ServerSignatureDate}} |
| 25 | // - {{SignerIP}} |
| 26 | // - {{SignerUserAgent}} |
| 27 | // |
| 28 | // Only translate the text outside the curly braces, such as: |
| 29 | // - "Signed with LibreSign" |
| 30 | // - "Issuer:" |
| 31 | // - "Date:" |
| 32 | // - "IP:" |
| 33 | // - "User agent:" |
| 34 | return $l10n->t( |
| 35 | "Signed with LibreSign\n" |
| 36 | . "{{SignerCommonName}}\n" |
| 37 | . "Issuer: {{IssuerCommonName}}\n" |
| 38 | . "Date: {{ServerSignatureDate}}\n" |
| 39 | . "IP: {{SignerIP}}\n" |
| 40 | . 'User agent: {{SignerUserAgent}}' |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | // TRANSLATORS Variables enclosed in double curly braces {{variableName}} are template placeholders. |
| 45 | // |
| 46 | // DO NOT translate or remove these variables: |
| 47 | // - {{SignerCommonName}} |
| 48 | // - {{IssuerCommonName}} |
| 49 | // - {{ServerSignatureDate}} |
| 50 | // |
| 51 | // Only translate the text outside the curly braces, such as: |
| 52 | // - "Signed with LibreSign" |
| 53 | // - "Issuer:" |
| 54 | // - "Date:" |
| 55 | return $l10n->t( |
| 56 | "Signed with LibreSign\n" |
| 57 | . "{{SignerCommonName}}\n" |
| 58 | . "Issuer: {{IssuerCommonName}}\n" |
| 59 | . 'Date: {{ServerSignatureDate}}' |
| 60 | ); |
| 61 | } |
| 62 | } |