Closed
Description
Hello, I am using Symfony 4.4 and I just realized that when using the following command:
php bin/console translation:update --force en
The command doesn't take into account the specified domain, for example:
class ChangePasswordFormType extends AbstractType
{
/**
* @var TranslatorInterface
*/
private $translator;
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
/**
* @param mixed[] $options
* @param FormBuilderInterface<FormBuilderInterface|string> $builder
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$message = $this->translator->trans('This is the string I would like to translate', $parameters = [], $domain = 'validators');
// other code...
}
}
The string This is the string I would like to translate
should be inserted in the file validators.en.xlf
but it's written in the messages.en.xlf
file.
Thanks!