Language Switcher block should only show available languages in the related language

By admin_wla |

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.

0
0