private function getTranslationDomain(FormInterface $form)
	{
		$translation = $form->getConfig()->getOption('translation_domain');
		if (empty($translation))
		{
			$parent = $form->getParent();

			if (empty($parent))
			    $translation = 'messages';

			while (empty($translation))
			{
				$translation = $parent->getConfig()->getOption('translation_domain');
				$parent      = $parent->getParent();
				if (! $parent instanceof FormInterface && empty($translation))
					$translation = 'messages';
			}
		}

		return $translation = $translation === 'messages' ? null : $translation;  // Allow the Symfony Default setting to be used by returning null.
	}
private function getTranslationDomain(FormInterface $form)
	{
		$translation = $form->getConfig()->getOption('translation_domain');
		if (empty($translation))
		{
			$parent = $form->getParent();

			if (empty($parent))
			    $translation = 'messages';

			while (empty($translation))
			{
				$translation = $parent->getConfig()->getOption('translation_domain');
				$parent      = $parent->getParent();
				if (! $parent instanceof FormInterface && empty($translation))
					$translation = 'messages';
			}
		}

		return $translation = $translation === 'messages' ? null : $translation;  // Allow the Symfony Default setting to be used by returning null.
	}
private function getTranslationDomain ( FormInterface $ form ) { $ translation = $ form -> getConfig ( ) -> getOption ( 'translation_domain' ) ; if ( empty ( $ translation ) ) { $ parent = $ form -> getParent ( ) ; if ( empty ( $ parent ) ) $ translation = 'messages' ; while ( empty ( $ translation ) ) { $ translation = $ parent -> getConfig ( ) -> getOption ( 'translation_domain' ) ; $ parent = $ parent -> getParent ( ) ; if ( ! $ parent instanceof FormInterface && empty ( $ translation ) ) $ translation = 'messages' ; } } return $ translation = $ translation === 'messages' ? null : $ translation ; // Allow the Symfony Default setting to be used by returning null. }
Find the Translation Domain.

Needs to be done for each element as sub forms or elements could have different translation domains.

@param   FormInterface $form

@return  string
Find the Translation Domain .