Skip to content

Commit

Permalink
IBX-6415: Renamed UI translations domain names (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikadamczyk authored Sep 5, 2023
1 parent e10b472 commit 644878d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function visit(Visitor $visitor, Generator $generator, $data)
/** @Ignore */
$this->translationToString($translation),
$translation->values,
'repository_exceptions'
'ibexa_repository_exceptions'
)
);

Expand Down
6 changes: 4 additions & 2 deletions src/lib/Server/Output/ValueObjectVisitor/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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.';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 644878d

Please sign in to comment.