isFrontPage() ? '' : ''; $type = 'language_interface'; $language_links = $languageManager->getLanguageSwitchLinks($type, Url::fromRoute($route_name)); $variables['language'] = []; foreach ($language_links->links as $langcode => $link) { $language_links->links[$langcode]['attributes']['class'][] = 'navbar-item'; $language_links->links[$langcode]['title'] = $langcode; } $variables['language'] = [ '#theme' => 'links__language_block', '#links' => $language_links->links, '#set_active_class' => TRUE, ]; }