You are here

function locale_language_list in Drupal 7

Same name and namespace in other branches
  1. 6 modules/locale/locale.module \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()
locale_date_format_form in modules/locale/locale.admin.inc
Provide date localization configuration options to users.
locale_date_format_language_overview_page in modules/locale/locale.admin.inc
Display edit date format links for each language.
locale_form_node_form_alter in modules/locale/locale.module
Implements hook_form_BASE_FORM_ID_alter().
locale_form_path_admin_form_alter in modules/locale/locale.module
Implements hook_form_FORM_ID_alter().
locale_language_name in modules/locale/locale.module
Returns a language name

... See full list

File

modules/locale/locale.module, line 844
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;
}