Commit de3558c2 authored by alexpott's avatar alexpott

Issue #2024867 by vijaycs85: Rename translation_entity() to content_translation().

parent a9b5c816
......@@ -63,7 +63,7 @@ class EntityType extends Plugin {
* Defaults to \Drupal\Core\Entity\EntityAccessController.
* - translation: The name of the controller class that should be used to
* handle the translation process. The class must implement
* \Drupal\translation_entity\EntityTranslationControllerInterface.
* \Drupal\content_translation\ContentTranslationControllerInterface.
*
* @todo Interfaces from outside \Drupal\Core or \Drupal\Component should not
* be used here.
......@@ -148,7 +148,7 @@ class EntityType extends Plugin {
public $translatable = FALSE;
/**
* @todo translation_entity_entity_info_alter() uses this but it is undocumented.
* @todo content_translation_entity_info_alter() uses this but it is undocumented.
*
* @var array
*/
......
......@@ -8,22 +8,22 @@
namespace Drupal\custom_block;
use Drupal\Core\Entity\EntityInterface;
use Drupal\translation_entity\EntityTranslationControllerNG;
use Drupal\content_translation\ContentTranslationControllerNG;
/**
* Defines the translation controller class for custom blocks.
*/
class CustomBlockTranslationController extends EntityTranslationControllerNG {
class CustomBlockTranslationController extends ContentTranslationControllerNG {
/**
* Overrides EntityTranslationController::getAccess().
* Overrides ContentTranslationController::getAccess().
*/
public function getAccess(EntityInterface $entity, $op) {
return user_access('administer blocks');
}
/**
* Overrides EntityTranslationController::entityFormAlter().
* Overrides ContentTranslationController::entityFormAlter().
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
......@@ -40,7 +40,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
}
/**
* Overrides EntityTranslationController::entityFormTitle().
* Overrides ContentTranslationController::entityFormTitle().
*/
protected function entityFormTitle(EntityInterface $entity) {
$block_type = entity_load('custom_block_type', $entity->type->value);
......
......@@ -52,7 +52,7 @@ public function form(array $form, array &$form_state) {
'#description' => t('Create a new revision by default for this block type.')
);
if (module_exists('translation_entity')) {
if (module_exists('content_translation')) {
$form['language'] = array(
'#type' => 'details',
'#title' => t('Language settings'),
......
......@@ -7,13 +7,13 @@
namespace Drupal\custom_block\Tests;
use Drupal\translation_entity\Tests\EntityTranslationUITest;
use Drupal\content_translation\Tests\ContentTranslationUITest;
use Drupal\custom_block\Plugin\Core\Entity\CustomBlock;
/**
* Tests the Custom Block Translation UI.
*/
class CustomBlockTranslationUITest extends EntityTranslationUITest {
class CustomBlockTranslationUITest extends ContentTranslationUITest {
/**
* The name of the test block.
......@@ -27,7 +27,7 @@ class CustomBlockTranslationUITest extends EntityTranslationUITest {
*/
public static $modules = array(
'language',
'translation_entity',
'content_translation',
'block',
'field_ui',
'custom_block'
......@@ -56,7 +56,7 @@ public function setUp() {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::getTranslatorPermission().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission().
*/
public function getTranslatorPermissions() {
return array_merge(parent::getTranslatorPermissions(), array(
......@@ -93,7 +93,7 @@ protected function createCustomBlock($title = FALSE, $bundle = FALSE) {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::getNewEntityValues().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues().
*/
protected function getNewEntityValues($langcode) {
return array('info' => $this->name) + parent::getNewEntityValues($langcode);
......@@ -117,8 +117,8 @@ public function testDisabledBundle() {
$disabled_custom_block = $this->createCustomBlock(FALSE, $bundle->id());
// Make sure that only a single row was inserted into the
// {translation_entity} table.
$rows = db_query('SELECT * FROM {translation_entity}')->fetchAll();
// {content_translation} table.
$rows = db_query('SELECT * FROM {content_translation}')->fetchAll();
$this->assertEqual(1, count($rows));
$this->assertEqual($enabled_custom_block->id(), reset($rows)->entity_id);
}
......
......@@ -139,7 +139,7 @@ function comment_admin_overview($form, &$form_state, $arg) {
'href' => 'comment/' . $comment->id() . '/edit',
'query' => $destination,
);
if (module_invoke('translation_entity', 'translate_access', $comment)) {
if (module_invoke('content_translation', 'translate_access', $comment)) {
$links['translate'] = array(
'title' => t('translate'),
'href' => 'comment/' . $comment->id() . '/translations',
......
......@@ -954,7 +954,7 @@ function comment_links(Comment $comment, EntityInterface $node) {
}
// Add translations link for translation-enabled comment bundles.
if (module_exists('translation_entity') && translation_entity_translate_access($comment)) {
if (module_exists('content_translation') && content_translation_translate_access($comment)) {
$links['comment-translations'] = array(
'title' => t('translate'),
'href' => 'comment/' . $comment->id() . '/translations',
......@@ -1059,10 +1059,10 @@ function comment_form_node_type_form_alter(&$form, $form_state) {
),
);
// @todo Remove this check once language settings are generalized.
if (module_exists('translation_entity')) {
if (module_exists('content_translation')) {
$comment_form = $form;
$comment_form_state['translation_entity']['key'] = 'language_configuration';
$form['comment'] += translation_entity_enable_widget('comment', 'comment_node_' . $form['#node_type']->type, $comment_form, $comment_form_state);
$comment_form_state['content_translation']['key'] = 'language_configuration';
$form['comment'] += content_translation_enable_widget('comment', 'comment_node_' . $form['#node_type']->type, $comment_form, $comment_form_state);
array_unshift($form['#submit'], 'comment_translation_configuration_element_submit');
}
}
......@@ -1083,11 +1083,11 @@ function comment_translation_configuration_element_submit($form, &$form_state) {
// settings.
$key = 'language_configuration';
$comment_form_state = array(
'translation_entity' => array('key' => $key),
'content_translation' => array('key' => $key),
'language' => array($key => array('entity_type' => 'comment', 'bundle' => 'comment_node_' . $form['#node_type']->type)),
'values' => array($key => array('translation_entity' => $form_state['values']['translation_entity'])),
'values' => array($key => array('content_translation' => $form_state['values']['content_translation'])),
);
translation_entity_language_configuration_element_submit($form, $comment_form_state);
content_translation_language_configuration_element_submit($form, $comment_form_state);
}
/**
......
......@@ -360,12 +360,12 @@ function comment_views_data() {
),
);
if (Drupal::moduleHandler()->moduleExists('translation_entity')) {
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' => 'translation_entity_link',
'id' => 'content_translation_link',
),
);
}
......
......@@ -9,15 +9,15 @@
namespace Drupal\comment;
use Drupal\Core\Entity\EntityInterface;
use Drupal\translation_entity\EntityTranslationControllerNG;
use Drupal\content_translation\ContentTranslationControllerNG;
/**
* Defines the translation controller class for comments.
*/
class CommentTranslationController extends EntityTranslationControllerNG {
class CommentTranslationController extends ContentTranslationControllerNG {
/**
* Overrides EntityTranslationController::entityFormTitle().
* Overrides ContentTranslationController::entityFormTitle().
*/
protected function entityFormTitle(EntityInterface $entity) {
return t('Edit comment @subject', array('@subject' => $entity->label()));
......
......@@ -7,12 +7,12 @@
namespace Drupal\comment\Tests;
use Drupal\translation_entity\Tests\EntityTranslationUITest;
use Drupal\content_translation\Tests\ContentTranslationUITest;
/**
* Tests the Comment Translation UI.
*/
class CommentTranslationUITest extends EntityTranslationUITest {
class CommentTranslationUITest extends ContentTranslationUITest {
/**
* The subject of the test comment.
......@@ -24,7 +24,7 @@ class CommentTranslationUITest extends EntityTranslationUITest {
*
* @var array
*/
public static $modules = array('language', 'translation_entity', 'node', 'comment');
public static $modules = array('language', 'content_translation', 'node', 'comment');
public static function getInfo() {
return array(
......@@ -44,7 +44,7 @@ function setUp() {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::setupBundle().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupBundle().
*/
function setupBundle() {
parent::setupBundle();
......@@ -52,14 +52,14 @@ function setupBundle() {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::getTranslatorPermission().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getTranslatorPermission().
*/
protected function getTranslatorPermissions() {
return array_merge(parent::getTranslatorPermissions(), array('post comments', 'administer comments'));
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::setupTestFields().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupTestFields().
*/
function setupTestFields() {
parent::setupTestFields();
......@@ -69,7 +69,7 @@ function setupTestFields() {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::createEntity().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::createEntity().
*/
protected function createEntity($values, $langcode, $node_bundle = NULL) {
if (!isset($node_bundle)) {
......@@ -82,7 +82,7 @@ protected function createEntity($values, $langcode, $node_bundle = NULL) {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::getNewEntityValues().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::getNewEntityValues().
*/
protected function getNewEntityValues($langcode) {
// Comment subject is not translatable hence we use a fixed value.
......@@ -93,7 +93,7 @@ protected function getNewEntityValues($langcode) {
}
/**
* Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::assertPublishedStatus().
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::assertPublishedStatus().
*/
protected function assertPublishedStatus() {
parent::assertPublishedStatus();
......
......@@ -5,9 +5,9 @@
/**
* Forces applicable options to be checked as translatable.
*/
Drupal.behaviors.translationEntityDependentOptions = {
Drupal.behaviors.contentTranslationDependentOptions = {
attach: function (context, settings) {
var $options = settings.translationEntityDependentOptions;
var $options = settings.contentTranslationDependentOptions;
var $collections = [];
// We're given a generic name to look for so we find all inputs containing
......@@ -24,11 +24,11 @@ Drupal.behaviors.translationEntityDependentOptions = {
var $dependent_columns = $collection.dependent_columns;
$fields.change(function() {
Drupal.behaviors.translationEntityDependentOptions.check($fields, $dependent_columns, $(this));
Drupal.behaviors.contentTranslationDependentOptions.check($fields, $dependent_columns, $(this));
});
// Run the check function on first trigger of this behavior.
Drupal.behaviors.translationEntityDependentOptions.check($fields, $dependent_columns, false);
Drupal.behaviors.contentTranslationDependentOptions.check($fields, $dependent_columns, false);
});
},
check: function($fields, $dependent_columns, $changed) {
......@@ -58,7 +58,7 @@ Drupal.behaviors.translationEntityDependentOptions = {
/**
* Makes field translatability inherit bundle translatability.
*/
Drupal.behaviors.translationEntity = {
Drupal.behaviors.contentTranslation = {
attach: function (context) {
// Initially hide all field rows for non translatable bundles and all column
// rows for non translatable fields.
......
......@@ -2,7 +2,7 @@
/**
* @file
* Installation functions for Entity Translation module.
* Installation functions for Content Translation module.
*/
use Drupal\Core\Language\Language;
......@@ -10,9 +10,9 @@
/**
* Implements hook_schema().
*/
function translation_entity_schema() {
$schema['translation_entity'] = array(
'description' => 'Table to track entity translations',
function content_translation_schema() {
$schema['content_translation'] = array(
'description' => 'Table to track content translations',
'fields' => array(
'entity_type' => array(
'type' => 'varchar',
......@@ -81,10 +81,10 @@ function translation_entity_schema() {
/**
* Implements hook_install().
*/
function translation_entity_install() {
function content_translation_install() {
// Assign a fairly low weight to ensure our implementation of
// hook_module_implements_alter() is run among the last ones.
module_set_weight('translation_entity', 10);
module_set_weight('content_translation', 10);
language_negotiation_include();
language_negotiation_set(Language::TYPE_CONTENT, array(LANGUAGE_NEGOTIATION_URL => 0));
}
......@@ -92,7 +92,7 @@ function translation_entity_install() {
/**
* Implements hook_enable().
*/
function translation_entity_enable() {
function content_translation_enable() {
// Translation works when at least two languages are enabled.
if (count(language_list()) < 2) {
$t_args = array('!language_url' => url('admin/config/regional/language'));
......
......@@ -2,7 +2,7 @@
/**
* @file
* The entity translation user interface.
* The content translation user interface.
*/
use Drupal\Core\Language\Language;
......@@ -15,8 +15,8 @@
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose translation overview should be displayed.
*/
function translation_entity_overview(EntityInterface $entity) {
$controller = translation_entity_controller($entity->entityType());
function content_translation_overview(EntityInterface $entity) {
$controller = content_translation_controller($entity->entityType());
$entity_manager = Drupal::entityManager();
$languages = language_list();
$original = $entity->language()->langcode;
......@@ -34,7 +34,7 @@ function translation_entity_overview(EntityInterface $entity) {
// If we have a view path defined for the current entity get the switch
// links based on it.
if ($path) {
$links = _translation_entity_get_switch_links($path);
$links = _content_translation_get_switch_links($path);
}
// Determine whether the current entity is translatable.
......@@ -56,10 +56,10 @@ function translation_entity_overview(EntityInterface $entity) {
$delete_path = $base_path . '/translations/delete/' . $langcode;
if ($base_path) {
$add_links = _translation_entity_get_switch_links($add_path);
$edit_links = _translation_entity_get_switch_links($edit_path);
$translate_links = _translation_entity_get_switch_links($translate_path);
$delete_links = _translation_entity_get_switch_links($delete_path);
$add_links = _content_translation_get_switch_links($add_path);
$edit_links = _content_translation_get_switch_links($edit_path);
$translate_links = _content_translation_get_switch_links($translate_path);
$delete_links = _content_translation_get_switch_links($delete_path);
}
$operations = array(
......@@ -146,7 +146,7 @@ function translation_entity_overview(EntityInterface $entity) {
// which entity this is.
$build['#entity'] = $entity;
$build['translation_entity_overview'] = array(
$build['content_translation_overview'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
......@@ -164,7 +164,7 @@ function translation_entity_overview(EntityInterface $entity) {
* @returns
* A renderable array of language switch links.
*/
function _translation_entity_get_switch_links($path) {
function _content_translation_get_switch_links($path) {
$links = language_negotiation_get_switch_links(Language::TYPE_CONTENT, $path);
if (empty($links)) {
// If content language is set up to fall back to the interface language,
......@@ -190,18 +190,18 @@ function _translation_entity_get_switch_links($path) {
* @return array
* A processed form array ready to be rendered.
*/
function translation_entity_add_page(EntityInterface $entity, Language $source = NULL, Language $target = NULL) {
function content_translation_add_page(EntityInterface $entity, Language $source = NULL, Language $target = NULL) {
$source = !empty($source) ? $source : $entity->language();
$target = !empty($target) ? $target : language(Language::TYPE_CONTENT);
// @todo Exploit the upcoming hook_entity_prepare() when available.
translation_entity_prepare_translation($entity, $source, $target);
content_translation_prepare_translation($entity, $source, $target);
$info = $entity->entityInfo();
$operation = isset($info['default_operation']) ? $info['default_operation'] : 'default';
$form_state['langcode'] = $target->langcode;
$form_state['translation_entity']['source'] = $source;
$form_state['translation_entity']['target'] = $target;
$controller = translation_entity_controller($entity->entityType());
$form_state['translation_entity']['translation_form'] = !$controller->getAccess($entity, 'update');
$form_state['content_translation']['source'] = $source;
$form_state['content_translation']['target'] = $target;
$controller = content_translation_controller($entity->entityType());
$form_state['content_translation']['translation_form'] = !$controller->getAccess($entity, 'update');
return Drupal::entityManager()->getForm($entity, $operation, $form_state);
}
......@@ -217,12 +217,12 @@ function translation_entity_add_page(EntityInterface $entity, Language $source =
* @return array
* A processed form array ready to be rendered.
*/
function translation_entity_edit_page(EntityInterface $entity, Language $language = NULL) {
function content_translation_edit_page(EntityInterface $entity, Language $language = NULL) {
$language = !empty($language) ? $language : language(Language::TYPE_CONTENT);
$info = $entity->entityInfo();
$operation = isset($info['default_operation']) ? $info['default_operation'] : 'default';
$form_state['langcode'] = $language->langcode;
$form_state['translation_entity']['translation_form'] = TRUE;
$form_state['content_translation']['translation_form'] = TRUE;
return Drupal::entityManager()->getForm($entity, $operation, $form_state);
}
......@@ -236,7 +236,7 @@ function translation_entity_edit_page(EntityInterface $entity, Language $languag
* @param \Drupal\Core\Language\Language $target
* The language to be used as target.
*/
function translation_entity_prepare_translation(EntityInterface $entity, Language $source, Language $target) {
function content_translation_prepare_translation(EntityInterface $entity, Language $source, Language $target) {
// @todo Unify field and property handling.
$instances = field_info_instances($entity->entityType(), $entity->bundle());
$entity = $entity->getNGEntity();
......@@ -265,9 +265,9 @@ function translation_entity_prepare_translation(EntityInterface $entity, Languag
/**
* Form constructor for the translation deletion confirmation.
*/
function translation_entity_delete_confirm(array $form, array $form_state, EntityInterface $entity, Language $language) {
function content_translation_delete_confirm(array $form, array $form_state, EntityInterface $entity, Language $language) {
$langcode = $language->langcode;
$controller = translation_entity_controller($entity->entityType());
$controller = content_translation_controller($entity->entityType());
return confirm_form(
$form,
......@@ -280,11 +280,11 @@ function translation_entity_delete_confirm(array $form, array $form_state, Entit
}
/**
* Form submission handler for translation_entity_delete_confirm().
* Form submission handler for content_translation_delete_confirm().
*/
function translation_entity_delete_confirm_submit(array $form, array &$form_state) {
function content_translation_delete_confirm_submit(array $form, array &$form_state) {
list($entity, $language) = $form_state['build_info']['args'];
$controller = translation_entity_controller($entity->entityType());
$controller = content_translation_controller($entity->entityType());
// Remove the translated values.
$controller->removeTranslation($entity, $language->langcode);
......
services:
translation_entity.synchronizer:
class: Drupal\translation_entity\FieldTranslationSynchronizer
content_translation.synchronizer:
class: Drupal\content_translation\FieldTranslationSynchronizer
arguments: ['@plugin.manager.entity']
......@@ -2,24 +2,24 @@
/**
* @file
* Definition of Drupal\translation_entity\EntityTranslationControllerInterface.
* Definition of Drupal\content_translation\ContentTranslationControllerInterface.
*/
namespace Drupal\translation_entity;
namespace Drupal\content_translation;
use Drupal\Core\Entity\EntityInterface;
/**
* Interface for providing entity translation.
* Interface for providing content translation.
*
* Defines a set of methods to allow any entity to be processed by the entity
* translation UI.
*
* The entity translation UI relies on the entity info to provide its features.
* The content translation UI relies on the entity info to provide its features.
* See the documentation of hook_entity_info() in the Entity API documentation
* for more details on all the entity info keys that may be defined.
*
* To make Entity Translation automatically support an entity type some keys
* To make Content Translation automatically support an entity type some keys
* may need to be defined, but none of them is required unless the entity path
* is different from ENTITY_TYPE/%ENTITY_TYPE (e.g. taxonomy/term/1), in which
* case at least the 'menu_base_path' key must be defined. This is used to
......@@ -38,19 +38,19 @@
* Every entity type needs a translation controller to be translated. This can
* be specified through the "controllers['translation']" key in the entity
* info. If an entity type is enabled for translation and no translation
* controller is defined, Drupal\translation_entity\EntityTranslationController
* controller is defined, Drupal\content_translation\ContentTranslationController
* will be assumed. Every translation controller class must implement
* Drupal\translation_entity\EntityTranslationControllerInterface.
* Drupal\content_translation\ContentTranslationControllerInterface.
*
* If the entity paths match the default patterns above and there is no need for
* an entity-specific translation controller class, Entity Translation will
* an entity-specific translation controller class, Content Translation will
* provide built-in support for the entity. It will still be required to enable
* translation for each translatable bundle.
*
* Additionally some more entity info keys can be defined to further customize
* the translation UI. The entity translation info is an associative array that
* the translation UI. The content translation info is an associative array that
* has to match the following structure. Two nested arrays keyed respectively
* by the 'translation' key and the 'translation_entity' key. Elements:
* by the 'translation' key and the 'content_translation' key. Elements:
* - access callback: The access callback for the translation pages. Defaults to
* 'entity_translation_translate_access'.
* - access arguments: The access arguments for the translation pages. By
......@@ -64,19 +64,19 @@
* 'menu_base_path' => 'mymodule/myentity/%my_entity_loader',
* 'menu_path_wildcard' => '%my_entity_loader',
* 'translation' => array(
* 'translation_entity' => array(
* 'content_translation' => array(
* 'access_callback' => 'mymodule_myentity_translate_access',
* 'access_arguments' => array(2),
* ),
* ),
* );
* $info['myentity']['controllers'] += array('translation' => 'Drupal\mymodule\MyEntityTranslationController');
* $info['myentity']['controllers'] += array('translation' => 'Drupal\mymodule\MyContentTranslationController');
* }
* @endcode
*
* @see \Drupal\Core\Entity\EntityManager
*/
interface EntityTranslationControllerInterface {
interface ContentTranslationControllerInterface {
/**
* Returns the base path for the current entity.
......
......@@ -2,27 +2,27 @@
/**
* @file
* Contains \Drupal\translation_entity\EntityTranslationControllerNG.
* Contains \Drupal\content_translation\ContentTranslationControllerNG.
*/
namespace Drupal\translation_entity;
namespace Drupal\content_translation;
use Drupal\Core\Entity\EntityInterface;
/**
* Test entity translation controller.
* Test content translation controller.
*/
class EntityTranslationControllerNG extends EntityTranslationController {
class ContentTranslationControllerNG extends ContentTranslationController {
/**
* Overrides \Drupal\translation_entity\EntityTranslationController::getAccess().
* Overrides \Drupal\content_translation\ContentTranslationController::getAccess().
*/
public function getAccess(EntityInterface $entity, $op) {
return $entity->access($op);
}
/**
* Overrides \Drupal\translation_entity\EntityTranslationControllerInterface::removeTranslation().
* Overrides \Drupal\content_translation\ContentTranslationControllerInterface::removeTranslation().
*/
public function removeTranslation(EntityInterface $entity, $langcode) {
$translation = $entity->getTranslation($langcode);
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\translation_entity\FieldTranslationSynchronizer.
* Contains \Drupal\content_translation\FieldTranslationSynchronizer.
*/
namespace Drupal\translation_entity;
namespace Drupal\content_translation;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityManager;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\translation_entity\FieldTranslationSynchronizerInterface.
* Contains \Drupal\content_translation\FieldTranslationSynchronizerInterface.
*/
namespace Drupal\translation_entity;
namespace Drupal\content_translation;
use Drupal\Core\Entity\EntityInterface;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\translation_entity\Plugin\views\field\TranslationLink.
* Contains \Drupal\content_translation\Plugin\views\field\TranslationLink.
*/
namespace Drupal\translation_entity\Plugin\views\field;
namespace Drupal\content_translation\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Component\Annotation\PluginID;
......@@ -16,7 +16,7 @@
*
* @ingroup views_field_handlers
*
* @PluginID("translation_entity_link")
* @PluginID("content_translation_link")
*/
class TranslationLink extends FieldPluginBase {
......@@ -60,7 +60,7 @@ function render($values) {
* The acutal rendered text (without the link) of this field.
*/
public function render_link(EntityInterface $entity, \stdClass $values) {
if (translation_entity_translate_access($entity)) {
if (content_translation_translate_access($entity)) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('translate');