You are here

function _locale_prepare_iso_list in Drupal 5

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

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

2 calls to _locale_prepare_iso_list()
locale_add_language_form in includes/locale.inc
_locale_admin_import in includes/locale.inc
User interface for the translation import screen.

File

includes/locale.inc, line 1454
Admin-related functions for locale.module.

Code

function _locale_prepare_iso_list() {
  $languages = locale_supported_languages(FALSE, TRUE);
  $isocodes = _locale_get_iso639_list();
  foreach ($isocodes as $key => $value) {
    if (isset($languages['name'][$key])) {
      unset($isocodes[$key]);
      continue;
    }
    if (count($value) == 2) {
      $tname = t($value[0]);
      $isocodes[$key] = $tname == $value[1] ? $tname : "{$tname} ({$value[1]})";
    }
    else {
      $isocodes[$key] = t($value[0]);
    }
  }
  asort($isocodes);
  return $isocodes;
}