public function LanguageSwitcherLinkProcessor::process in Language Switcher Extended 8
Processes the language switcher links.
Parameters
array $links: Language switcher links to be processed.
File
- src/
LanguageSwitcherLinkProcessor.php, line 60
Class
- LanguageSwitcherLinkProcessor
- Processes the Language Switcher links.
Namespace
Drupal\language_switcher_extendedCode
public function process(array &$links) {
$config = $this->configFactory
->get('language_switcher_extended.settings');
switch ($config
->get('mode')) {
case 'always_link_to_front':
$this
->processAlwaysLinkToFrontpage($links);
break;
case 'process_untranslated':
$this
->processUntranslatedLinks($links);
break;
}
// If there's no more links after the processing there's nothing more to do.
if (empty($links)) {
return;
}
// This will run if the mode is not "core/default".
switch ($config
->get('current_language_mode')) {
case 'hide_link':
$this
->hideCurrentLanguage($links);
break;
case 'no_link':
$this
->hideCurrentLanguageLink($links);
break;
}
// Show language instead of language name.
if ($config
->get('show_langcode')) {
$this
->showLanguageCode($links);
}
}