# How can I get the language name of the current node?

I'm trying to figure out how to get the name of the language of the current node in display suite. I find a language option under one of the node categories in the dynamic field content selector, but that outputs the language code, not the name. Do I need to handle this in a preprocess function or is there some way of getting this that I've not managed to find?

<?php
return t(locale_language_name($entity->language)); ?>  3. Don't forget to activate the "Display Suite code" text format for this code field. 4. Add this code field to your content type's display! Hope this helps! • That does look better than what I've done. I got tied up doing something else, but shortly I'll try this out. Thanks! – UltraBob May 20 '16 at 23:46 Here's what I've done. I'd love a better answer: in my templates.php in my theme (the dynamic field I created in display suite is called language): function MYTHEME_preprocess_field(&$variables) {
if ($fieldname == 'language') {$item['#markup'] = locale_language_name(\$item['#markup']);