/**
  * Add a translated flash to the flashbag, using the translation domain from the definition.
  * @param DefinitionInterface $definition
  * @param string              $type
  * @param string              $message
  * @param array               $vars
  */
 protected function addTranslatedFlash(DefinitionInterface $definition, $type, $message, array $vars = [])
 {
     /** @var Translator $trans */
     $trans = $this->get('translator');
     $message = $trans->trans($message, $vars, $definition->getTranslationDomain());
     /** @var Session $session */
     $session = $this->get('session');
     $session->getFlashBag()->add($type, $message);
 }