Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

locale_language_name() in Drupal 7 was used in modules like node and path module to display the name of languages as applied to the nodes and paths in question. Because node and path module did not want to depend on locale module for obvious reasons, a module_invoke('locale', 'language_name') pattern was used. To avoid such oddities and make language handling easier, locale_langugae_name() became language_name() and is now always available in the system if you need a language display name without loading the rest of the language object.

Drupal 7:

$language_name = module_invoke('locale', 'language_name', $langcode);

Drupal 8:

$language_name = language_name($langcode);

language_name() will also return more useful data if the language was not loadable (eg. the language was deleted earlier), and will return language names for disabled languages too.

Impacts: 
Site builders, administrators, editors