EntityQuery not returning content based on language I'm trying to get a list of all of a specific content type, but my entityQuery is only returning the original language of the site (English). Here's my code:

  public function fetchDocumentReferenceOptions() {
$language = \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getId();
$query = \Drupal::entityQuery('node')
  -&gt;condition('status', 1)
  -&gt;condition('type', 'document')
  -&gt;condition('langcode', $language)
  -&gt;sort('title', 'ASC');

$nids = $query-&gt;execute();

$nodes = node_load_multiple($nids);

$options = [];

foreach($nodes as $node)
{
  // check if the document (content type) has an uploaded file
  if ($node-&gt;field_document-&gt;entity) {
      $options[$node-&gt;id()] = $node-&gt;getTitle();
  }
}

return $options;


}

This is how I call the function:

'#options' =&gt; $DocumentReferenceCore-&gt;fetchDocumentReferenceOptions(),


What I am expecting, based on condition for langcode would be that, if, for example, I am editing a Chinese language node (translated from the original English node), I should see Chinese nodes, and the content being returned, but instead I am still seeing the original English content.

What am I doing wrong here?
Content entities have an active language concept. If load them, they by default return values for the default translation.

With your query, you know it has that translation, so you can do $node = $node->getTranslation($language);. If you're not sure it exists, you can use $custom_tag = \Drupal::service('entity.repository')-&gt;getTranslationFromContext($node, $desired_langcode);. That will return the node in the matching translation if it exists, or the best alternative. You can also leave out the langcode, then it defaults to the current content language.