File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,20 +250,7 @@ public function getTextOfStatus(int|FileStatus $status): string {
250250 if (is_int ($ status )) {
251251 $ status = FileStatus::from ($ status );
252252 }
253- return match ($ status ) {
254- // TRANSLATORS Name of the status when document is not a LibreSign file
255- FileStatus::NOT_LIBRESIGN_FILE => $ this ->l ->t ('not LibreSign file ' ),
256- // TRANSLATORS Name of the status that the document is still as a draft
257- FileStatus::DRAFT => $ this ->l ->t ('draft ' ),
258- // TRANSLATORS Name of the status that the document can be signed
259- FileStatus::ABLE_TO_SIGN => $ this ->l ->t ('available for signature ' ),
260- // TRANSLATORS Name of the status when the document has already been partially signed
261- FileStatus::PARTIAL_SIGNED => $ this ->l ->t ('partially signed ' ),
262- // TRANSLATORS Name of the status when the document has been completely signed
263- FileStatus::SIGNED => $ this ->l ->t ('signed ' ),
264- // TRANSLATORS Name of the status when the document was deleted
265- FileStatus::DELETED => $ this ->l ->t ('deleted ' ),
266- };
253+ return $ status ->getLabel ($ this ->l );
267254 }
268255
269256 public function neutralizeDeletedUser (string $ userId , string $ displayName ): void {
Original file line number Diff line number Diff line change 99
1010namespace OCA \Libresign \Enum ;
1111
12+ use OCP \IL10N ;
13+
1214/**
1315 * File status enum
1416 *
@@ -21,4 +23,21 @@ enum FileStatus: int {
2123 case PARTIAL_SIGNED = 2 ;
2224 case SIGNED = 3 ;
2325 case DELETED = 4 ;
26+
27+ public function getLabel (IL10N $ l10n ): string {
28+ return match ($ this ) {
29+ // TRANSLATORS Name of the status when document is not a LibreSign file
30+ self ::NOT_LIBRESIGN_FILE => $ l10n ->t ('not LibreSign file ' ),
31+ // TRANSLATORS Name of the status that the document is still as a draft
32+ self ::DRAFT => $ l10n ->t ('draft ' ),
33+ // TRANSLATORS Name of the status that the document can be signed
34+ self ::ABLE_TO_SIGN => $ l10n ->t ('available for signature ' ),
35+ // TRANSLATORS Name of the status when the document has already been partially signed
36+ self ::PARTIAL_SIGNED => $ l10n ->t ('partially signed ' ),
37+ // TRANSLATORS Name of the status when the document has been completely signed
38+ self ::SIGNED => $ l10n ->t ('signed ' ),
39+ // TRANSLATORS Name of the status when the document was deleted
40+ self ::DELETED => $ l10n ->t ('deleted ' ),
41+ };
42+ }
2443}
You can’t perform that action at this time.
0 commit comments