How to add translation of all content?
You can get all nodes, then with a foreach create a translation for each node. 

$nodes = \Drupal::entityQuery("node")
//-&gt;condition('type', 'my_custom_type') //use this for specific content types
-&gt;execute();

$nodes =  \Drupal\node\Entity\Node::loadMultiple($nids);

foreach ($nodes as $node) {
  //Creating the translation Spanish in this case
  $node_es = $node-&gt;addTranslation('es');
  $node_es-&gt;title = 'Mi prueba!';
  $node_es-&gt;body-&gt;value = '&lt;p&gt;El cuerpo de mi nodo.&lt;/p&gt;';
  $node_es-&gt;body-&gt;format = 'full_html';
  //Saving the node
  $node_es-&gt;save();
}


You can add some fields like title and body, or just save.