Replacement of global $language Drupal 7: global $language; // return lang code; return $language->language; Drupal 8: return $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); Reply