Stores entity translation settings.
array $settings: An associative array of settings keyed by entity type and bundle. At bundle level the following keys are available:
function translation_entity_save_settings($settings) {
foreach ($settings as $entity_type => $entity_settings) {
foreach ($entity_settings as $bundle => $bundle_settings) {
// The 'translatable' value is set only if it is possible to enable.
if (isset($bundle_settings['translatable'])) {
// Store whether a bundle has translation enabled or not.
translation_entity_set_config($entity_type, $bundle, 'enabled', $bundle_settings['translatable']);
// Store whether fields have translation enabled or not.
if (!empty($bundle_settings['columns'])) {
foreach ($bundle_settings['columns'] as $field_name => $column_settings) {
$field = field_info_field($field_name);
$instance = field_info_instance($entity_type, $field_name, $bundle);
if ($field['translatable']) {
$instance['settings']['translation_sync'] = $column_settings;
}
else {
unset($instance['settings']['translation_sync']);
}
field_update_instance($instance);
}
}
}
}
}
// Ensure entity and menu router information are correctly rebuilt.
entity_info_cache_clear();
menu_router_rebuild();
}