Use default translations for the NotBlank constraint

This commit is contained in:
Jan Böhmer 2025-11-09 17:08:07 +01:00
parent 15e9d9e81f
commit c6ea46b702
4 changed files with 4 additions and 26 deletions

View file

@ -52,7 +52,7 @@ class DataSourceSynonymRowType extends AbstractType
'choices' => $this->buildDataSourceChoices($options['data_sources']),
'required' => true,
'constraints' => [
new Assert\NotBlank(message: 'settings.system.data_source_synonyms.row_type.value_not_blank'),
new Assert\NotBlank(),
],
])
->add('locale', LocaleType::class, [
@ -63,7 +63,7 @@ class DataSourceSynonymRowType extends AbstractType
'choices' => $this->buildLocaleChoices(true),
'preferred_choices' => $this->getPreferredLocales(),
'constraints' => [
new Assert\NotBlank(message: 'settings.system.data_source_synonyms.row_type.value_not_blank'),
new Assert\NotBlank(),
],
])
->add('translation_singular', TextType::class, [
@ -71,7 +71,7 @@ class DataSourceSynonymRowType extends AbstractType
'required' => true,
'empty_data' => '',
'constraints' => [
new Assert\NotBlank(message: 'settings.system.data_source_synonyms.row_type.value_not_blank'),
new Assert\NotBlank(),
],
])
->add('translation_plural', TextType::class, [
@ -79,7 +79,7 @@ class DataSourceSynonymRowType extends AbstractType
'required' => true,
'empty_data' => '',
'constraints' => [
new Assert\NotBlank(message: 'settings.system.data_source_synonyms.row_type.value_not_blank'),
new Assert\NotBlank(),
],
]);
}
@ -133,9 +133,5 @@ class DataSourceSynonymRowType extends AbstractType
{
$resolver->setRequired('data_sources');
$resolver->setAllowedTypes('data_sources', 'array');
$resolver->setDefaults([
'error_translation_domain' => 'validators',
]);
}
}