Feb 02, 2018 in Drupal 8, Snippets

The following snippet will return your langcode f.e. 'en', 'nl', etc. Use the following code:

// Get current language code
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();