diff --git a/src/Form/Type/TranslationsFormsType.php b/src/Form/Type/TranslationsFormsType.php index 4347274..c627fdf 100644 --- a/src/Form/Type/TranslationsFormsType.php +++ b/src/Form/Type/TranslationsFormsType.php @@ -74,6 +74,10 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $translation->locale = $locale; // @phpstan-ignore property.notFound $translationColl->add($translation); }, + 'getter' => static function (Collection $translationColl, FormInterface $form) use ($locale): ?OneLocaleInterface { + /** @var Collection $translationColl */ + return $translationColl->findFirst(static fn (int|string $_key, OneLocaleInterface $translation): bool => $translation->locale === $locale); // @phpstan-ignore property.notFound + }, // LocaleExtension options process 'label' => $options['locale_labels'][$locale] ?? null, 'required' => \in_array($locale, $options['required_locales'], true),