Cannot get translated value for an entity inside twig Inside a custom module I get the translated nodes like this:

$ids = Drupal::entityQuery('node')
    -&gt;condition('type', 'event')
    -&gt;condition('status', 1)
    -&gt;execute();

$nodes = Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadMultiple($ids);

$events = array_map(function ($node) {
    return Drupal::entityManager()-&gt;getTranslationFromContext($node);
}, $nodes);


and inside the template:

&lt;div class="events"&gt;
  {% for event in events %}
    &lt;div&gt;
      &lt;h4&gt;{{ event.title.value }}&lt;/h4&gt;
      &lt;div class="event-type"&gt;
        {{ event.field_event_type.entity.name.value }}
      &lt;/div&gt;
    &lt;/div&gt;
  {% endfor %}
&lt;/div&gt;


The event_type entity which is a taxonomy is displayed in the original language always. How can I get the translated value for the entity too?
You would need to prepare the taxonomy entities the same way like the nodes. But normally it's not your job to do either of this.

Use viewMultiple() instead of array_map() in the first php example:

$nodes = \Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadMultiple($ids);
$build = \Drupal::entityTypeManager()-&gt;getViewBuilder('node')-&gt;viewMultiple($nodes, $view_mode);
$variables['events'] = $build;


In Twig:

{{ events }}


Customize the twig of the view mode specific event content type and other templates like the taxonomy field template if needed.