diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index a6cf31c..4e0f062 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -126,6 +126,53 @@ function content_translation_entity_bundle_info_alter(&$bundles) { } /** + * Implements hook_entity_field_info(). + */ +function content_translation_entity_field_info($entity_type) { + if (content_translation_enabled($entity_type)) { + $info = array(); + $info['definitions']['translation_source'] = array( + 'label' => t('Translation source'), + 'description' => t('The source language from which this translation was created.'), + 'type' => 'language_field', + ); + $info['definitions']['translation_outdated'] = array( + 'label' => t('Translation outdated'), + 'description' => t('A boolean indicating whether this translation needs to be updated.'), + 'type' => 'boolean_field', + ); + $info['definitions']['translation_uid'] = array( + 'label' => t('Translation author id'), + 'description' => t('The author of this translation.'), + 'type' => 'entity_reference_field', + 'settings' => array('target_type' => 'user'), + ); + $info['definitions']['translation_status'] = array( + 'label' => t('Translation status'), + 'description' => t('Boolean indicating whether the translation is visible to non-translators.'), + 'type' => 'boolean_field', + 'settings' => array( + 'default_value' => 1, + ), + ); + $info['definitions']['translation_created'] = array( + 'label' => t('Translation created time'), + 'description' => t('The Unix timestamp when the translation was created.'), + 'type' => 'integer_field', + ); + $info['definitions']['translation_changed'] = array( + 'label' => t('Translation changed time'), + 'description' => t('The Unix timestamp when the translation was most recently saved.'), + 'type' => 'integer_field', + 'property_constraints' => array( + 'value' => array('EntityChanged' => array()), + ), + ); + return $info; + } +} + +/** * Implements hook_menu(). */ function content_translation_menu() {