$field) { $query = new EntityFieldQuery(); $count = $query ->fieldLanguageCondition($field, LANGUAGE_NONE, '!=') ->range(0, 1) ->count() ->execute(); if ($count > 0) { $valid_languages = FALSE; break; } } if ($valid_languages) { foreach (entity_get_info() as $entity_type => $info) { // Entities having a field translation handler associated must not be // touched, since in this case changing the field translatable property // might have an impact on the site behavior. if ($info['fieldable'] && !field_has_translation_handler($entity_type)) { foreach (field_info_instances($entity_type) as $bundle => $info) { foreach ($info as $field_name => $instance) { $field = &$field_info[$field_name]; if ($field['translatable']) { // Turn off translatability for every field for which this is safe. $field['translatable'] = FALSE; field_update_field($field); } } } } } // Ensure that the updated values are correctly picked up. field_info_cache_clear(); $log(t('Field translatablility update performed.')); } $log(t('Field translatablility update complete.')); drupal_goto('');