How to get a referencedEntity field value in current node language I am trying to get some node's content inside a block.

I managed to get the fields i wanted, but they are always returned in my site default language instead of the current translations (ex. /node/1 and /fr/node/1 returns the same english content instead of the translation)

It works fine for simple fields, but can't get it to work for referencedEntities : 

I am inside a Block build() function :

$node = \Drupal::routeMatch()-&gt;getParameter('node');

// Simple text field : Correct value depending on language
$correctValue = $node-&gt;field_test_text-&gt;getValue(); 

// Paragraphs/referencedEntities
$paras = $node-&gt;get('field_paragraphes')-&gt;referencedEntities();
foreach ($paras as $para) {
   // Not translated, always in default language ?
   $badValue = $para-&gt;get('field_test_in_para')-&gt;getValue();
}


Thanks a lot.
The code for your problem (You need to use getTranslation to get a translation and hasTranslation to check is is it actually has a translation or not):

$lang_code = \Drupal::service('language_manager')-&gt;getCurrentLanguage()-&gt;getId();
$node = \Drupal::routeMatch()-&gt;getParameter('node');

// Paragraphs/referencedEntities
$paras = $node-&gt;get('field_paragraphes')-&gt;referencedEntities();
foreach ($paras as $para) {
  // Remember to check if translation exists
  if ($para-&gt;hasTranslation($lang_code)) {
    $para = $para-&gt;getTranslation($lang_code);
  }
   $goodValue = $para-&gt;get('field_test_in_para')-&gt;getValue();
}


Eventhough this code will work and fix your problem, you might consider if you are doing things right. Most of the time, when doing things the proper way, you wont need to handle translations. A lot of modules/systems does this automatically when rendering stuff or using modules like views. Most of the time, when you need to handle translations yourself, there would be a simpler way to do this.