Add new comment | Drupal 8

Add new comment

KaedSaugos (not verified)

Fri, 01/24/2020 - 21:27

I tried this, and I am getting lang-english for all languages even after clearing all cache.

function mytheme_preprocess_html(&$variables) {
$language = \Drupal::languageManager()->getCurrentLanguage()->getName();
$variables['language'] = $language;

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.