protected function formatMessage(\stdClass $event)
    {
        $message = false;

        // Check for required properties.
        if (isset($event->message, $event->variables)) {
            // Messages without variables or user specified text.
            if ($event->variables === 'N;') {
                return $event->message;
            }

            return $this->stringTranslation->translate(
                $event->message,
                unserialize($event->variables)
            );
        }

        return $message;
    }