You are here

function _locale_prepare_iso_list in Drupal 4

Same name and namespace in other branches
  1. 5 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_admin_import_screen in includes/locale.inc
User interface for the translation import screen.
_locale_admin_manage_add_screen in includes/locale.inc
User interface for the language addition screen.

File

includes/locale.inc, line 1348
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;
}