diff --git a/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php b/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php index 41434ce..1e06a01 100644 --- a/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php +++ b/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php @@ -193,7 +193,7 @@ class InlineEntityFormComplex extends InlineEntityFormBase implements ContainerF // Get the langcode of the parent entity. $parent_langcode = $items->getParent()->getValue()->language()->getId(); - $target_langcode = $parent_langcode; + $target_langcode = $form_state->get('langcode') ?: $parent_langcode; // Determine the wrapper ID for the entire element. $wrapper = 'inline-entity-form-' . $this->getIefId();