How to progragrammatically get NodeType translated value in D8? Fetching node translation

$node = Node::load($nid);
$node-&gt;getTitle(); // returns title in en(default language).
$translated_node = \Drupal::service('entity.repository')-&gt;getTranslationFromContext($node, 'es');
$translated_node-&gt;getTitle(); // Returns translated title in es (spanish).


If we want to fetch the bundle's translation. The above approach doesn't work. 

Kindly advise? 

$article = $node-&gt;bundle();
$article-&gt;label(); // returns "Article".
$translated = \Drupal::service('entity.repository')-&gt;getTranslationFromContext($article, 'es');
$translated-&gt;label(); // Also returns "Article". 


Translation for bundles provided from /admin/structure/types/manage/article/translate/es/edit
You need to set the config override language to the desired language:

  $language = $language_manager-&gt;getLanguage('es');
  $original_language = $language_manager-&gt;getConfigOverrideLanguage();
  $language_manager-&gt;setConfigOverrideLanguage($language);

  // Load the node type here.       

  $language_manager-&gt;setConfigOverrideLanguage($original_language);


Taken from user_mail()