Preprocess language switcher block
We added a filter to drop the languages that did not have translations from the language switcher.  Here's the code from that:

/**
 * Implements hook_block_view_BASE_BLOCK_ID_alter().
 */
function mymodule_block_view_language_block_alter(array &amp;$build, BlockPluginInterface $block) {
  $build['#pre_render'][] = '_mymodule_language_block_prerender';
}


FYI - Used pre_render because I was removing links from the [content][[#links] element.