Language name of translated node
If you want to use the method language() in Twig

{{ node.language.name }}


you have to add it to the whitelist of the Twig sandbox policy in settings.php:

$settings['twig_sandbox_whitelisted_methods'] = [
  'id',
  'label',
  'bundle',
  'get',
  '__toString',
  'toString',
  'language',
];