private function getTranslatedMessage(Exception $exception)
    {
        $message = $exception->getMessage();
        if ($exception instanceof Translatable) {
            $message = $this->translator->trans($exception->getMessageTemplate(), $exception->getParameters(), 'repository_exceptions');
        }

        return $message;
    }
private function getTranslatedMessage(Exception $exception)
    {
        $message = $exception->getMessage();
        if ($exception instanceof Translatable) {
            $message = $this->translator->trans($exception->getMessageTemplate(), $exception->getParameters(), 'repository_exceptions');
        }

        return $message;
    }
private function getTranslatedMessage ( Exception $ exception ) { $ message = $ exception -> getMessage ( ) ; if ( $ exception instanceof Translatable ) { $ message = $ this -> translator -> trans ( $ exception -> getMessageTemplate ( ) , $ exception -> getParameters ( ) , 'repository_exceptions' ) ; } return $ message ; }
Translates the exception message if it is translatable.

@param Exception $exception

@return string
Translates the exception message if it is translatable .