You are here

function locale_language_list in Drupal 6

Same name and namespace in other branches
  1. 7 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

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

File

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