function locale_language_list

Returns array of language names

Parameters

$field: 'name' => names in current language, localized 'native' => native names

$all: Boolean to return all languages or only enabled ones

9 calls to locale_language_list()

File

drupal/modules/locale/locale.module, line 843
Add language handling functionality and enables the translation of the user interface to languages other than English.

Code

function locale_language_list($field = 'name', $all = FALSE) {
  if ($all) {
    $languages = language_list();
  }
  else {
    $languages = language_list('enabled');
    $languages = $languages[1];
  }
  $list = array();
  foreach ($languages as $language) {
    $list[$language->language] = $field == 'name' ? t($language->name) : $language->{$field};
  }
  return $list;
}