machine_name;
if (isset($form['i18n_translation']['i18n_mode'])) {
$args = array('!url' => url('admin/config/regional/entity_translation'));
$form['i18n_translation']['i18n_mode']['#options'][I18N_MODE_ENTITY_TRANSLATION] = t('Field translation. Term fields will be translated through the Entity translation module.', $args);
if (entity_translation_enabled_bundle('taxonomy_term', $name)) {
$form['i18n_translation']['i18n_mode']['#default_value'] = I18N_MODE_ENTITY_TRANSLATION;
}
}
else {
$form['entity_translation_taxonomy'] = array(
'#title' => t('Enable field translation'),
'#type' => 'checkbox',
'#prefix' => '',
'#default_value' => entity_translation_enabled('taxonomy_term', $name),
);
}
$form['#submit'][] = 'entity_translation_form_taxonomy_form_vocabulary_submit';
}
}
/**
* Submit handler for the taxonomy vocabulary form.
*/
function entity_translation_form_taxonomy_form_vocabulary_submit($form, &$form_state) {
if (!empty($form_state['values']['i18n_mode']) && $form_state['values']['i18n_mode'] == I18N_MODE_ENTITY_TRANSLATION) {
$form_state['values']['entity_translation_taxonomy'] = TRUE;
}
$info = variable_get('entity_translation_taxonomy', array());
$info[$form_state['vocabulary']->machine_name] = !empty($form_state['values']['entity_translation_taxonomy']);
variable_set('entity_translation_taxonomy', $info);
}