I'm trying to create a translation on a node's paragraph field whose paragraph contains a text field and an image field. The code below updates the text field as expected but the image field is always blank/empty for the translated node:
<?php
$img[] = array(
'target_id' => 1029,
'alt' => 'Translated alt tag',
'title' => '',
);
$desc1[] = array(
'value' => 'Translated Text',
'summary' => '',
'format' => 'basic_html',
);
$lang_node->field_images_descriptions->entity
->addTranslation($lang_code, [
'field_product_image' => $img,
'field_product_description' => $desc1,
])
->save();
$img
then try to access$img1
later. – sonfd Feb 15 at 19:12