Form constructor for the confirmation of translatability switching.
function translation_entity_translatable_form(array $form, array &$form_state, $field_name) {
$field = field_info_field($field_name);
$t_args = array(
'%name' => $field_name,
);
$warning = t('By submitting this form these changes will apply to the %name field everywhere it is used.', $t_args);
if ($field['translatable']) {
$title = t('Are you sure you want to disable translation for the %name field?', $t_args);
$warning .= "<br>" . t("<strong>All the existing translations of this field will be deleted.</strong><br>This action cannot be undone.");
}
else {
$title = t('Are you sure you want to enable translation for the %name field?', $t_args);
}
// We need to keep some information for later processing.
$form_state['field'] = $field;
// Store the 'translatable' status on the client side to prevent outdated form
// submits from toggling translatability.
$form['translatable'] = array(
'#type' => 'hidden',
'#default_value' => $field['translatable'],
);
return confirm_form($form, $title, '', $warning);
}