For a teaser view mode I want to display the language of the content. I can get the langcode in twig with: {{ node.langcode.value }}
But how can I display the language name? In the field display I get only the string with "Language English", but I want only the name without any other thinks like "Language ...".
One way is to use preprocess node:
function mytheme_preprocess_node(&$variables) {
$variables['lang_name'] = $variables['node']->language()->getName()
}
in the template file:
{{ lang_name }}
Is there a pure twig solution possible?