Language switcher footer #297

Merged
gnuget merged 1 commit from language-switcher-footer into master 2019-01-22 18:32:20 +00:00

View file

@ -24,8 +24,8 @@ function agarica_languague_switch_link() {
$route = \Drupal::getContainer()->get('path.matcher')->isFrontPage() ? '<front>' : '<current>'; $route = \Drupal::getContainer()->get('path.matcher')->isFrontPage() ? '<front>' : '<current>';
$current_language = \Drupal::languageManager()->getCurrentLanguage($derivative_id)->getId(); $current_language = \Drupal::languageManager()->getCurrentLanguage($derivative_id)->getId();
$links = \Drupal::languageManager()->getLanguageSwitchLinks($derivative_id, Url::fromRoute($route))->links; $links = \Drupal::languageManager()->getLanguageSwitchLinks($derivative_id, Url::fromRoute($route))->links;
$links['en']['title'] = 'Browser this page on English.'; $links['en']['title'] = 'Browse this site in English';
$links['es']['title'] = 'Consulta esta pagina en Español'; $links['es']['title'] = 'Consulta este sitio en Español';
$lid = ($current_language == 'en') ? 'es' : 'en'; $lid = ($current_language == 'en') ? 'es' : 'en';
// Remove current language from the links // Remove current language from the links
unset($links[$current_language]); unset($links[$current_language]);