Determines whether the given entity type is translatable.
@returns TRUE if the specified bundle is translatable. If no bundle is provided returns TRUE if at least one of the entity bundles is translatable.
string $entity_type: The type of the entity.
string $bundle: (optional) The bundle of the entity. If no bundle is provided, all the available bundles are checked.
boolean $skip_handler: (optional) Specifies whether the availablity of a field translation handler should affect the returned value. By default the check is performed.
function translation_entity_enabled($entity_type, $bundle = NULL, $skip_handler = FALSE) {
$enabled = FALSE;
$bundles = !empty($bundle) ? array(
$bundle,
) : entity_get_bundles($entity_type);
foreach ($bundles as $bundle) {
if (translation_entity_get_config($entity_type, $bundle, 'enabled')) {
$enabled = TRUE;
break;
}
}
return $enabled && ($skip_handler || field_has_translation_handler($entity_type, 'translation_entity'));
}