function locale_language_list

7.x locale.module locale_language_list($field = 'name', $all = FALSE)
6.x locale.module locale_language_list($field = 'name', $all = FALSE)

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

5 calls to locale_language_list()
locale_form_alter in drupal-6.x/modules/locale/locale.module
Implementation of hook_form_alter(). Adds language fields to forms.
locale_language_name in drupal-6.x/modules/locale/locale.module
Returns a language name
locale_translate_export_screen in drupal-6.x/includes/locale.inc
User interface for the translation export screen.
locale_translate_import_form in drupal-6.x/includes/locale.inc
User interface for the translation import screen.
locale_translate_seek_form in drupal-6.x/includes/locale.inc
User interface for the string search screen.

File

drupal-6.x/modules/locale/locale.module, line 456
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;
}