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()
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 846

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.