function _locale_prepare_predefined_list
7.x locale.inc | _locale_prepare_predefined_list() |
6.x 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 drupal-6.x/
includes/ locale.inc - Predefined language setup form.
- locale_translate_import_form in drupal-6.x/
includes/ locale.inc - User interface for the translation import screen.
File
- drupal-6.x/
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;
}