diff --git a/lib/public/Sharing/Property/ABooleanSharePropertyType.php b/lib/public/Sharing/Property/ABooleanSharePropertyType.php index 7df7ff0e8005b..14c2531a03f80 100644 --- a/lib/public/Sharing/Property/ABooleanSharePropertyType.php +++ b/lib/public/Sharing/Property/ABooleanSharePropertyType.php @@ -30,7 +30,7 @@ public function validateValue(IFactory $l10nFactory, string $value): true|string return true; } - return $l10nFactory->get(Application::APP_ID)->t('Only true and false are valid values: ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Only true and false are valid values: %s', [$value]); } /** diff --git a/lib/public/Sharing/Property/ADateSharePropertyType.php b/lib/public/Sharing/Property/ADateSharePropertyType.php index 81afe690e1078..be8fd67998dbc 100644 --- a/lib/public/Sharing/Property/ADateSharePropertyType.php +++ b/lib/public/Sharing/Property/ADateSharePropertyType.php @@ -46,15 +46,15 @@ public function validateValue(IFactory $l10nFactory, string $value): true|string } if ($date === false) { - return $l10nFactory->get(Application::APP_ID)->t('Invalid ISO date: ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Invalid ISO date: %s', [$value]); } if (($minDate = $this->getMinDate()) instanceof DateTimeImmutable && $date->diff($minDate)->invert === 0) { - return $l10nFactory->get(Application::APP_ID)->t('Date needs to be after ' . $minDate->format(DateTimeInterface::ATOM) . ': ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Date needs to be after %s: %s', [$minDate->format(DateTimeInterface::ATOM), $value]); } if (($maxDate = $this->getMaxDate()) instanceof DateTimeImmutable && $date->diff($maxDate)->invert === 1) { - return $l10nFactory->get(Application::APP_ID)->t('Date needs to be before ' . $maxDate->format(DateTimeInterface::ATOM) . ': ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Date needs to be before %s: %s', [$maxDate->format(DateTimeInterface::ATOM), $value]); } return true; diff --git a/lib/public/Sharing/Property/AEnumSharePropertyType.php b/lib/public/Sharing/Property/AEnumSharePropertyType.php index 5f67bdb72fee5..5c970f4361174 100644 --- a/lib/public/Sharing/Property/AEnumSharePropertyType.php +++ b/lib/public/Sharing/Property/AEnumSharePropertyType.php @@ -37,7 +37,7 @@ public function validateValue(IFactory $l10nFactory, string $value): true|string return true; } - return $l10nFactory->get(Application::APP_ID)->t('Only ' . implode(', ', $validValues) . ' are valid values: ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Only %s are valid values: %s', [implode(', ', $validValues), $value]); } /** diff --git a/lib/public/Sharing/Property/AStringSharePropertyType.php b/lib/public/Sharing/Property/AStringSharePropertyType.php index 396b43e81f05a..8db080d010308 100644 --- a/lib/public/Sharing/Property/AStringSharePropertyType.php +++ b/lib/public/Sharing/Property/AStringSharePropertyType.php @@ -39,11 +39,11 @@ abstract public function getMaxLength(): ?int; #[\Override] public function validateValue(IFactory $l10nFactory, string $value): true|string { if (($minLength = $this->getMinLength()) !== null && mb_strlen($value) < $minLength) { - return $l10nFactory->get(Application::APP_ID)->t('Need at least ' . $minLength . ' characters: ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Need at least %s characters: %s', [$minLength, $value]); } if (($maxLength = $this->getMaxLength()) !== null && mb_strlen($value) > $maxLength) { - return $l10nFactory->get(Application::APP_ID)->t('Provide ' . $maxLength . ' characters at most: ' . $value); + return $l10nFactory->get(Application::APP_ID)->t('Provide %s characters at most: %s', [$maxLength, $value]); } return true;