function content_translation_field_info_alter in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/content_translation/content_translation.module \content_translation_field_info_alter()
Implements hook_field_info_alter().
Content translation extends the @FieldType annotation with following key:
- column_groups: contains information about the field type properties which columns should be synchronized across different translations and which are translatable. This is useful for instance to translate the "alt" and "title" textual elements of an image field, while keeping the same image on every translation.
See also
Drupal\image\Plugin\Field\FieldType\imageItem.
File
- core/
modules/ content_translation/ content_translation.module, line 206 - Allows entities to be translated into different languages.
Code
function content_translation_field_info_alter(&$info) {
foreach ($info as $key => $settings) {
// Supply the column_groups key if it's not there.
if (empty($settings['column_groups'])) {
$info[$key]['column_groups'] = array();
}
}
}