Update language configuration
This commit is contained in:
parent
f05461ba95
commit
bd26b1501e
299 changed files with 26 additions and 1828 deletions
25
web/themes/custom/agarica/agarica.theme
Normal file
25
web/themes/custom/agarica/agarica.theme
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use \Drupal\Core\Url;
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_block__system_menu_block__main().
|
||||
*/
|
||||
function agarica_preprocess_block__system_menu_block__main(&$variables) {
|
||||
$pathMatcher = \Drupal::service('path.matcher');
|
||||
$languageManager = \Drupal::service('language_manager');
|
||||
$route_name = $pathMatcher->isFrontPage() ? '<front>' : '<current>';
|
||||
$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,
|
||||
];
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue