How can I get my module to see the current language my user is using? When I use Node::load(10)-&gt;toArray() I see that my module thinks that the current language is English. I have the language key (fr) in the url and when I place \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getId() in my code it says (fr). How can I get Node::load(10) to see the current language the user is using?

When I translate the content type into another language, all translations of the same page seem to have the same id to place into the load function.
You could try the following:

$lang_code = \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getId();
Node::load(10)-&gt;getTranslation($lang_code)-&gt;toArray();


Good luck!