diff --git a/src/i18n/Messages/Symfony/FlushInvalidatedResource.php b/src/i18n/Messages/Symfony/FlushInvalidatedResource.php index 95de3bb1900..0fc066f5c3a 100644 --- a/src/i18n/Messages/Symfony/FlushInvalidatedResource.php +++ b/src/i18n/Messages/Symfony/FlushInvalidatedResource.php @@ -27,7 +27,7 @@ public function getResource() return null; } - public function isFresh($timestamp) + public function isFresh(int $timestamp): bool { // Check mtime of canary $canary = static::canary(); diff --git a/src/i18n/Messages/Symfony/ModuleYamlLoader.php b/src/i18n/Messages/Symfony/ModuleYamlLoader.php index d7f4f3fcefa..dc04f490e8c 100644 --- a/src/i18n/Messages/Symfony/ModuleYamlLoader.php +++ b/src/i18n/Messages/Symfony/ModuleYamlLoader.php @@ -7,6 +7,7 @@ use SilverStripe\i18n\i18n; use SilverStripe\i18n\Messages\Reader; use Symfony\Component\Translation\Loader\ArrayLoader; +use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\PluralizationRules; /** @@ -23,7 +24,7 @@ class ModuleYamlLoader extends ArrayLoader */ protected $reader = null; - public function load($resource, $locale, $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { $messages = []; foreach ($resource as $path) { diff --git a/src/i18n/Messages/Symfony/SymfonyMessageProvider.php b/src/i18n/Messages/Symfony/SymfonyMessageProvider.php index 696a1d030f2..fa843916ba7 100644 --- a/src/i18n/Messages/Symfony/SymfonyMessageProvider.php +++ b/src/i18n/Messages/Symfony/SymfonyMessageProvider.php @@ -121,11 +121,11 @@ public function pluralise($entity, $default, $injection, $count) )); // Pass to symfony translator - $result = $this->getTranslator()->transChoice($entity, $count, $arguments, 'messages', $locale); + $result = $this->getTranslator()->trans($entity, $arguments, 'messages', $locale); // Manually inject default if no translation found if ($entity === $result) { - $result = $this->getTranslator()->transChoice($default, $count, $arguments, 'messages', $locale); + $result = $this->getTranslator()->trans($default, $arguments, 'messages', $locale); } return $result;