You are here

function facetapi_map_language in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.callbacks.inc \facetapi_map_language()
  2. 7.2 facetapi.callbacks.inc \facetapi_map_language()

Map callback for languages.

1 string reference to 'facetapi_map_language'
facetapi_facetapi_facet_info in ./facetapi.facetapi.inc
Implements hook_facetapi_facet_info().

File

./facetapi.callbacks.inc, line 52
Callbacks referenced in hook implementations.

Code

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