How do I get the translated title of a node? I have a content type available in FR and in EN.

In hook_node_presave(), I would like to concatenate the French title and the English title in another field. (This is an "helper field" which contains concatenate strings to be used by a filter in a view.)

This is my code.

function mymodule_node_presave(Drupal\Core\Entity\EntityInterface $entity) {
  $entity_title1=$entity-&gt;getTitle(); //It is the French title if the saved node is the french node.
  $entity_title2= '?'; //HERE IS MY PROBLEM: how to get the title in the other language?
  $entity-&gt;my_helper_field-&gt;setValue("$entity_title1 $entity_title1");
}


How do I get the translated title of a node?
You should load the translated entity, and get the title from that.

$translated_entity = $entity-&gt;getTranslation('en');
$translated_title = $translated_entity-&gt;getTitle();


You can get the current entity language using $entity-&gt;get('langcode')-&gt;value;, and as @4k4 says, you should check that a translation exists using $entity-&gt;hasTranslation($langcode);.