Drupal 8 - Clone nodes to node translation -
i have website in english.
i need put nodes of contentypes language client responsible entering , modifying data.
i know how go through nodes, know how create translation of node not know how duplicate fields of node in translation.
how it?
with code create translation node
$node = \drupal\node\entity\node::load($value_rowtotranslate->nid->value); $translation = $node->addtranslation('es'); $translation->title = "titulo traducido"; $translation->field_1 = "dasdas" $translation->field_2 = "xxxxxxxxx" ... $translation->field_n = "xxxxxxxxx" $translation->save();
Comments
Post a Comment