You can try to use this code for copy translation with all field types and all node types:
<?php
use Drupal\node\Entity\Node;
$exclude = [
'nid',
'vid',
'revision_timestamp',
'revision_uid',
'revision_log',
'revision_default',
'revision_translation_affected',
'content_translation_source',
'content_translation_outdated',
'created',
'changed',
'default_langcode',
'uuid'
];
$node = Node::load(NODE_ID);
if (!empty($node->hasTranslation(LANGCODE))) {
$node = $node->getTranslation(LANGCODE);
}
$node_type = $node->getType();
$fields = $node->getFieldDefinitions('node', $node_type);
$copyied_fields = [];
foreach ($fields as $field_name => $field_definition) {
$field_name = $field_definition->getName();
if (!in_array($field_name, $exclude)) {
$field_value = $node->$field_name->value;
if (empty($field_value)) {
$field_value = $node->$field_name->getValue();
}
$copyied_fields[$field_name] = $field_value;
// Add body format.
if ($field_name == 'body') {
$copyied_fields['body'] = array(
'value' => $node->body->value,
'format' => 'full_html',
);
}
}
}
$new_node = Node::create($copyied_fields);
$new_node->save();