Get current language in template In Drupal 7 the current language is a global variable we can access with 

global $language;
$langcode = $language-&gt;language; 


I want to know how can we access the current language in a Twig file in Drupal 8 (in page--front.html.twig for example)?
I found my answer and post it here so maybe it helps others later.

First, in MYTHEME.theme:

In Drupal 8.2 language got added to page the variables in template_preprocess_page. But in my current version 8.1 it didn't exist so I added it with:

function MYTHEME_preprocess_page(&amp;$vars) {

  $language = \Drupal::languageManager()-&gt;getCurrentLanguage()-&gt;getId();
  $vars['language'] = $language;
}


Then in my Twig file I use {{ language }}. Also I can get the language name with {{ language.getName() }}.

Update

After Drupal 8.2  a global variable language exists and now there's no more need to add it first.

{% if language.getId() == 'en' %}
  Do something
{% else %}
  Do something else
{% endif %}


Update
Thanks @Lucas for his comment

on Drupal > 8.7.5

{% if language.getId() == 'en' %} should be {% if language == 'en' %}