You are here

function _locale_prepare_predefined_list in Drupal 6

Same name and namespace in other branches
  1. 7 includes/locale.inc \_locale_prepare_predefined_list()

Prepares the language code list for a select form item with only the unsupported ones

Related topics

2 calls to _locale_prepare_predefined_list()
locale_languages_predefined_form in includes/locale.inc
Predefined language setup form.
locale_translate_import_form in includes/locale.inc
User interface for the translation import screen.

File

includes/locale.inc, line 2295
Administration functions for locale.module.

Code

function _locale_prepare_predefined_list() {
  $languages = language_list();
  $predefined = _locale_get_predefined_list();
  foreach ($predefined as $key => $value) {
    if (isset($languages[$key])) {
      unset($predefined[$key]);
      continue;
    }

    // Include native name in output, if possible
    if (count($value) > 1) {
      $tname = t($value[0]);
      $predefined[$key] = $tname == $value[1] ? $tname : "{$tname} ({$value[1]})";
    }
    else {
      $predefined[$key] = t($value[0]);
    }
  }
  asort($predefined);
  return $predefined;
}