diff --git a/src/bundle/Resources/translations/repository_exceptions.en.xliff b/src/bundle/Resources/translations/ibexa_repository_exceptions.en.xliff similarity index 100% rename from src/bundle/Resources/translations/repository_exceptions.en.xliff rename to src/bundle/Resources/translations/ibexa_repository_exceptions.en.xliff diff --git a/src/lib/Server/Output/ValueObjectVisitor/ContentFieldValidationException.php b/src/lib/Server/Output/ValueObjectVisitor/ContentFieldValidationException.php index 3e1975a0..22a99dbe 100644 --- a/src/lib/Server/Output/ValueObjectVisitor/ContentFieldValidationException.php +++ b/src/lib/Server/Output/ValueObjectVisitor/ContentFieldValidationException.php @@ -64,7 +64,7 @@ public function visit(Visitor $visitor, Generator $generator, $data) /** @Ignore */ $this->translationToString($translation), $translation->values, - 'repository_exceptions' + 'ibexa_repository_exceptions' ) ); diff --git a/src/lib/Server/Output/ValueObjectVisitor/Exception.php b/src/lib/Server/Output/ValueObjectVisitor/Exception.php index 51fe288b..129abe7b 100644 --- a/src/lib/Server/Output/ValueObjectVisitor/Exception.php +++ b/src/lib/Server/Output/ValueObjectVisitor/Exception.php @@ -10,6 +10,8 @@ use Ibexa\Contracts\Rest\Output\ValueObjectVisitor; use Ibexa\Contracts\Rest\Output\Visitor; use Ibexa\Core\Base\Translatable; +use JMS\TranslationBundle\Annotation\Desc; +use JMS\TranslationBundle\Annotation\Ignore; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -114,12 +116,12 @@ public function visit(Visitor $visitor, Generator $generator, $data) if ($this->debug || $statusCode < 500) { $errorDescription = $data instanceof Translatable && $this->translator - ? /** @Ignore */ $this->translator->trans($data->getMessageTemplate(), $data->getParameters(), 'repository_exceptions') + ? /** @Ignore */ $this->translator->trans($data->getMessageTemplate(), $data->getParameters(), 'ibexa_repository_exceptions') : $data->getMessage(); } else { // Do not leak any file paths and sensitive data on production environments $errorDescription = $this->translator - ? /** @Desc("An error has occurred. Please try again later or contact your Administrator.") */ $this->translator->trans('non_verbose_error', [], 'repository_exceptions') + ? /** @Desc("An error has occurred. Please try again later or contact your Administrator.") */ $this->translator->trans('non_verbose_error', [], 'ibexa_repository_exceptions') : 'An error has occurred. Please try again later or contact your Administrator.'; } diff --git a/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php b/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php index 67bf21ad..a7287aaa 100644 --- a/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php +++ b/tests/lib/Server/Output/ValueObjectVisitor/ExceptionTest.php @@ -41,7 +41,7 @@ public function testVisit() public function testVisitNonVerbose(): string { $this->getTranslatorMock()->method('trans') - ->with('non_verbose_error', [], 'repository_exceptions') + ->with('non_verbose_error', [], 'ibexa_repository_exceptions') ->willReturn(self::NON_VERBOSE_ERROR_DESCRIPTION); $visitor = $this->internalGetNonDebugVisitor();