Returns a widget to enable entity translation per entity bundle.
Backward compatibility layer to support entities not using the language configuration form element.
@todo Remove once all core entities have language configuration.
string $entity_type: The type of the entity being configured for translation.
string $bundle: The bundle of the entity being configured for translation.
array $form: The configuration form array.
array $form_state: The configuration form state array.
function translation_entity_enable_widget($entity_type, $bundle, array &$form, array &$form_state) {
$key = $form_state['translation_entity']['key'];
if (!isset($form_state['language'][$key])) {
$form_state['language'][$key] = array();
}
$form_state['language'][$key] += array(
'entity_type' => $entity_type,
'bundle' => $bundle,
);
$element = translation_entity_language_configuration_element_process(array(
'#name' => $key,
), $form_state, $form);
unset($element['translation_entity']['#element_validate']);
return $element;
}