You often need to get the current language in your Drupal 8 custom modules or theme. Here's how to get it:
$lang_code = \Drupal::languageManager()->getCurrentLanguage()->getId();
You often need to get the current language in your Drupal 8 custom modules or theme. Here's how to get it:
$lang_code = \Drupal::languageManager()->getCurrentLanguage()->getId();