diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index 66e2083..8d0b154 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -360,16 +360,6 @@ function comment_views_data() { ), ); - if (Drupal::moduleHandler()->moduleExists('content_translation')) { - $data['comment']['translation_link'] = array( - 'title' => t('Translation link'), - 'help' => t('Provide a link to the translations overview for comments.'), - 'field' => array( - 'id' => 'content_translation_link', - ), - ); - } - // Define the base group of this table. Fields that don't have a group defined // will go into this field by default. $data['node_comment_statistics']['table']['group'] = t('Content'); diff --git a/core/modules/content_translation/content_translation.views.inc b/core/modules/content_translation/content_translation.views.inc new file mode 100644 index 0000000..ad88ae5 --- /dev/null +++ b/core/modules/content_translation/content_translation.views.inc @@ -0,0 +1,31 @@ + $table_info) { + // Only for Entity Types that have translation enabled. + if (!empty($table_info['table']['entity type']) && content_translation_enabled($table_info['table']['entity type'])) { + // Get Entity info for the translatable entity type. + $entity_info = Drupal::entityManager()->getDefinition($table_info['table']['entity type']); + // Translation link field definition. + $data[$table_name]['translation_link'] = array( + 'title' => t('Translation link'), + 'help' => t('Provide a link to the translations overview for @entity_type_label.', array('@entity_type_label' => $entity_info['label'])), + 'field' => array( + 'id' => 'content_translation_link', + ), + ); + } + } +} diff --git a/core/modules/node/node.views.inc b/core/modules/node/node.views.inc index b2d00a6..60190cf 100644 --- a/core/modules/node/node.views.inc +++ b/core/modules/node/node.views.inc @@ -217,16 +217,6 @@ function node_views_data() { ); } - if (Drupal::moduleHandler()->moduleExists('content_translation')) { - $data['node']['translation_link'] = array( - 'title' => t('Translation link'), - 'help' => t('Provide a link to the translations overview for nodes.'), - 'field' => array( - 'id' => 'content_translation_link', - ), - ); - } - $data['node']['node_bulk_form'] = array( 'title' => t('Node operations bulk form'), 'help' => t('Add a form element that lets you run operations on multiple nodes.'), diff --git a/core/modules/taxonomy/taxonomy.views.inc b/core/modules/taxonomy/taxonomy.views.inc index 5646268..06145c6 100644 --- a/core/modules/taxonomy/taxonomy.views.inc +++ b/core/modules/taxonomy/taxonomy.views.inc @@ -176,17 +176,6 @@ function taxonomy_views_data() { ), ); - // Content translation field. - if (Drupal::moduleHandler()->moduleExists('content_translation')) { - $data['taxonomy_term_data']['translation_link'] = array( - 'title' => t('Translation link'), - 'help' => t('Provide a link to the translations overview for taxonomy terms.'), - 'field' => array( - 'id' => 'content_translation_link', - ), - ); - } - // taxonomy_index table $data['taxonomy_index']['table']['group'] = t('Taxonomy term'); diff --git a/core/modules/user/user.views.inc b/core/modules/user/user.views.inc index 0a8b49b..cb49a98 100644 --- a/core/modules/user/user.views.inc +++ b/core/modules/user/user.views.inc @@ -281,16 +281,6 @@ function user_views_data() { ), ); - if (Drupal::moduleHandler()->moduleExists('content_translation')) { - $data['users']['translation_link'] = array( - 'title' => t('Translation link'), - 'help' => t('Provide a link to the translations overview for users.'), - 'field' => array( - 'id' => 'content_translation_link', - ), - ); - } - $data['users']['edit_node'] = array( 'field' => array( 'title' => t('Link to edit user'),