Drupal 6 and 7 have two functions to get a list of languages, locale_language_list() and language_list(). Backdrop merges these two to offer one simplified API. The signatures for these two functions in Drupal 7:

function locale_language_list($field = 'name', $all = FALSE)
function language_list($field = 'langcode')

Because the $field argument was rarely used and caused misunderstanding even in core at places which used the API, Drupal 8 removes that argument. The $all argument got moved to the language_list() function and was renamed to $only_enabled and defaults to FALSE (all languages are returned by default). So in short, the old behavior of the list of languages returned by language_list() is the same, but it can now be limited to enabled only as well. The new signature is therefore as follows:

function language_list($only_enabled = FALSE)

The function returns a list of objects in all cases. Note that locale_language_list() could previously return a list of options suitable for a select list, but the new language_list() function does not. This may be corrected in later versions of Backdrop. See https://github.com/backdrop/backdrop-issues/issues/604.

Introduced in branch: 
Introduced in version: 
Module developers