2 * Implements hook_field_prepare_translation().
4 function {{ machine_name }}_field_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode) {
5 // If the translating user is not permitted to use the assigned text format,
6 // we must not expose the source values.
7 $field_name = $field['field_name'];
8 $formats = filter_formats();
9 $format_id = $source_entity->{$field_name}[$source_langcode][0]['format'];
10 if (!filter_access($formats[$format_id])) {