Create translated node programmatically I need to recreate the behavior drupal has when you create a translation but programmatically.

Doing $node-&gt;addTranslation('de'); on a hook insert create an empty node but I need the field to be filled with the untranslated node content.

Is there a way to achieve this instead of having to repopulate every field from the main node ?
addTranslation takes a second parameter, $values:


  An array of initial values to be assigned to the translatable fields. Defaults to none.


So in theory you should just need to make use of that parameter, and pass the node's current field values:

$node-&gt;addTranslation('de', $node-&gt;toArray());