You are here

function facetapi_callback_language_map in Facet API 6

Converts machine readable languages to

Parameters

$languages: An array containing the machine readable content types.

Return value

An array mapping the machine readable content types to the display names.

1 string reference to 'facetapi_callback_language_map'
facetapi_facetapi_facet_info in ./facetapi.module
Implementation of hook_facetapi_facet_info().

File

./facetapi.callbacks.inc, line 76
Various callbacks referenced in facet definitions.

Code

function facetapi_callback_language_map(array $languages) {
  $language_list = language_list();
  $map = array();
  foreach ($languages as $language) {
    if (isset($language_list[$language])) {
      $map[$language] = $language_list[$language]->name;
    }
    else {
      $map[$language] = t('Language neutral');
    }
  }
  return $map;
}