diff --git a/src/Forms/Component/Translate.php b/src/Forms/Component/Translate.php index 8de4000..edd5b73 100644 --- a/src/Forms/Component/Translate.php +++ b/src/Forms/Component/Translate.php @@ -249,8 +249,6 @@ public function getChildComponentContainers(bool $withHidden = false): array protected function prepareTranslateLocaleComponent(Component $component, string $locale): Component { - - $localeComponent = clone $component; if( method_exists($localeComponent,'getName')){ @@ -278,6 +276,15 @@ protected function prepareTranslateLocaleComponent(Component $component, string $localeComponent->name($component->getName().'.'.$locale); $localeComponent->statePath($localeComponent->getName()); } + } else { + $childComponents = $localeComponent->getChildComponents(); + if ($childComponents) { + $localeComponent->schema( + collect($childComponents) + ->map(fn ($childComponent) => $this->prepareTranslateLocaleComponent($childComponent, $locale)) + ->all() + ); + } } return $localeComponent;