How to modify the language switcher block to only use the language code instead of its full name? In the Language selection block, I have only the possibility to use the full language name. How can I change it to use the language code, for example FR instead of French?
One possible solution would be to insert this snippet in your .theme file

In this example I am using bartik as a theme.

/**
 * Implements hook_preprocess_HOOK() for block.html.twig.
 */
function bartik_preprocess_block(&amp;$variables) {
  if ($variables['plugin_id'] == 'language_block:language_interface') {
    foreach ($variables['content']['#links'] as $key =&gt; $value) {
      $variables['content']['#links'][$key]['title'] = strtoupper($key);
    }
  }
}


Please, let me know if this solution works for you.

Best regards,

Oleg