Returns all the translatable entity types.
array An array of entity types keyed by entity type.
function translation_entity_types_translatable() {
$entity_types =& drupal_static(__FUNCTION__, array());
foreach (entity_get_info() as $entity_type => $info) {
if (translation_entity_enabled($entity_type)) {
// Lazy load router items.
if (!isset($items)) {
$items = menu_get_router();
}
// Check whether the required paths are defined. We need to strip out the
// menu loader and replace it with a plain "%" as router items have no
// menu loader in them.
$path = _translation_entity_menu_strip_loaders($info['menu_base_path']);
if (!empty($items[$path]) && !empty($items[$path . '/translations'])) {
$entity_types[$entity_type] = $entity_type;
}
}
}
return $entity_types;
}