Language Switcher block should only show available languages in the related languageLanguage Switcher block should only show available languages in the related language
admin_wla Tue, 4 May 2021 - 13:17
Language switcher block is not handled via the "block_layout" page but called directly in the file "page.html.twig" in the used subtheme.
To ensure, that only available languages are shown, the function hook_preprocess_links__language_block() is used in the .theme file of the theme. Actually any language but 'en', 'es' and 'fr' gets removed from the link list and the title attribute of the accepted link get changed to the title of the corresponding language.