wxt_bootstrap-8.x-1.10/src/Plugin/Preprocess/ViewsViewFields.php
src/Plugin/Preprocess/ViewsViewFields.php
<?php
namespace Drupal\wxt_bootstrap\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\PreprocessBase;
/**
* Pre-processes variables for the "views_view_fields" theme hook.
*
* @ingroup plugins_preprocess
*
* @BootstrapPreprocess("views_view_fields")
*/
class ViewsViewFields extends PreprocessBase {
/**
* {@inheritdoc}
*/
public function preprocess(array &$variables, $hook, array $info) {
// Language Handling.
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
$language_prefix = \Drupal::config('language.negotiation')->get('url.prefixes');
$variables['language'] = $language;
$variables['language_prefix'] = $language_prefix[$language];
parent::preprocess($variables, $hook, $info);
}
}
