Untitled diff
677 lines
diff --git a/lingotek.links.task.yml b/lingotek.links.task.yml
diff --git a/lingotek.links.task.yml b/lingotek.links.task.yml
index a6d8cb7..ec85bd8 100644
index a6d8cb7..ec85bd8 100644
--- a/lingotek.links.task.yml
--- a/lingotek.links.task.yml
+++ b/lingotek.links.task.yml
+++ b/lingotek.links.task.yml
@@ -29,3 +29,9 @@ lingotek.import:
@@ -29,3 +29,9 @@ lingotek.import:
lingotek.manage.content:
lingotek.manage.content:
deriver: 'Drupal\lingotek\Plugin\Derivative\ContentTranslationLocalTasks'
deriver: 'Drupal\lingotek\Plugin\Derivative\ContentTranslationLocalTasks'
weight: 100
weight: 100
+
+
+lingotek.entity.manage:
+lingotek.entity.manage:
+ route_name: lingotek.entity.manage
+ route_name: lingotek.entity.manage
+ title: 'Manage Translations'
+ title: 'Manage Translations'
+ base_route: entity.node.canonical
+ base_route: entity.node.canonical
+ weight: 100
+ weight: 100
diff --git a/lingotek.routing.yml b/lingotek.routing.yml
diff --git a/lingotek.routing.yml b/lingotek.routing.yml
index c01e3b6..e95d790 100644
index c01e3b6..e95d790 100644
--- a/lingotek.routing.yml
--- a/lingotek.routing.yml
+++ b/lingotek.routing.yml
+++ b/lingotek.routing.yml
@@ -183,6 +183,14 @@ lingotek.entity.download:
@@ -183,6 +183,14 @@ lingotek.entity.download:
requirements:
requirements:
_permission: 'manage lingotek translations'
_permission: 'manage lingotek translations'
+lingotek.entity.manage:
+lingotek.entity.manage:
+ path: '/node/{node}/manage'
+ path: '/node/{node}/manage'
+ defaults:
+ defaults:
+ _form: '\Drupal\lingotek\Form\LingotekManagementEntityForm'
+ _form: '\Drupal\lingotek\Form\LingotekManagementEntityForm'
+ _title: 'Manage Translations'
+ _title: 'Manage Translations'
+ requirements:
+ requirements:
+ _permission: 'manage lingotek translations'
+ _permission: 'manage lingotek translations'
+
+
lingotek.config.upload:
lingotek.config.upload:
path: '/admin/lingotek/config/upload/{entity_type}/{entity_id}'
path: '/admin/lingotek/config/upload/{entity_type}/{entity_id}'
defaults:
defaults:
diff --git a/src/Form/LingotekManagementEntityForm.php b/src/Form/LingotekManagementEntityForm.php
diff --git a/src/Form/LingotekManagementEntityForm.php b/src/Form/LingotekManagementEntityForm.php
new file mode 100644
new file mode 100644
index 0000000..c44f6fc
index 0000000..c44f6fc
--- /dev/null
--- /dev/null
+++ b/src/Form/LingotekManagementEntityForm.php
+++ b/src/Form/LingotekManagementEntityForm.php
@@ -0,0 +1,339 @@
@@ -0,0 +1,339 @@
+<?php
+<?php
+
+
+/**
+/**
+ * @file
+ * @file
+ * Contains \Drupal\Lingotek\Form\LingotekManagementEntityForm.
+ * Contains \Drupal\Lingotek\Form\LingotekManagementEntityForm.
+ */
+ */
+
+
+namespace Drupal\lingotek\Form;
+namespace Drupal\lingotek\Form;
+
+
+use Drupal\lingotek\Form\LingotekManagementFormBase;
+use Drupal\lingotek\Form\LingotekManagementFormBase;
+use Drupal\content_translation\ContentTranslationManagerInterface;
+use Drupal\content_translation\ContentTranslationManagerInterface;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
+use Drupal\Core\State\StateInterface;
+use Drupal\Core\State\StateInterface;
+use Drupal\Core\Url;
+use Drupal\Core\Url;
+use Drupal\group\Entity\Group;
+use Drupal\group\Entity\Group;
+use Drupal\group\Plugin\GroupContentEnablerManagerInterface;
+use Drupal\group\Plugin\GroupContentEnablerManagerInterface;
+use Drupal\lingotek\LanguageLocaleMapperInterface;
+use Drupal\lingotek\LanguageLocaleMapperInterface;
+use Drupal\lingotek\Lingotek;
+use Drupal\lingotek\Lingotek;
+use Drupal\lingotek\LingotekConfigurationServiceInterface;
+use Drupal\lingotek\LingotekConfigurationServiceInterface;
+use Drupal\lingotek\LingotekContentTranslationServiceInterface;
+use Drupal\lingotek\LingotekContentTranslationServiceInterface;
+use Drupal\lingotek\LingotekInterface;
+use Drupal\lingotek\LingotekInterface;
+use Drupal\user\PrivateTempStore;
+use Drupal\user\PrivateTempStore;
+use Drupal\user\PrivateTempStoreFactory;
+use Drupal\user\PrivateTempStoreFactory;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+
+/**
+/**
+ * Form for bulk management of content.
+ * Form for bulk management of content.
+ */
+ */
+class LingotekManagementEntityForm extends LingotekManagementFormBase {
+class LingotekManagementEntityForm extends LingotekManagementFormBase {
+
+
+ /**
+ /**
+ * Constructs a new LingotekManagementForm object.
+ * Constructs a new LingotekManagementForm object.
+ *
+ *
+ * @param \Drupal\Core\Database\Connection $connection
+ * @param \Drupal\Core\Database\Connection $connection
+ * The current database connection.
+ * The current database connection.
+ * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+ * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+ * The entity manager.
+ * The entity manager.
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
+ * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
+ * The language manager.
+ * The language manager.
+ * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
+ * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
+ * The entity query factory.
+ * The entity query factory.
+ * @param \Drupal\lingotek\LingotekConfigurationServiceInterface $lingotek_configuration
+ * @param \Drupal\lingotek\LingotekConfigurationServiceInterface $lingotek_configuration
+ * The Lingotek configuration service.
+ * The Lingotek configuration service.
+ * @param \Drupal\lingotek\LanguageLocaleMapperInterface $language_locale_mapper
+ * @param \Drupal\lingotek\LanguageLocaleMapperInterface $language_locale_mapper
+ * The language-locale mapper.
+ * The language-locale mapper.
+ * @param \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service
+ * @param \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service
+ * The Lingotek content translation service.
+ * The Lingotek content translation service.
+ * @param \Drupal\content_translation\ContentTranslationManagerInterface $content_translation_manager
+ * @param \Drupal\content_translation\ContentTranslationManagerInterface $content_translation_manager
+ * The content translation manager.
+ * The content translation manager.
+ * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory
+ * @param \Drupal\user\PrivateTempStoreFactory $temp_store_factory
+ * The factory for the temp store object.
+ * The factory for the temp store object.
+ * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+ * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+ * The module handler.
+ * The module handler.
+ * @param string $entity_type_id
+ * @param string $entity_type_id
+ * The entity type id.
+ * The entity type id.
+ */
+ */
+ public function __construct(Connection $connection, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, QueryFactory $entity_query, LingotekInterface $lingotek, LingotekConfigurationServiceInterface $lingotek_configuration, LanguageLocaleMapperInterface $language_locale_mapper, ContentTranslationManagerInterface $content_translation_manager, LingotekContentTranslationServiceInterface $translation_service, PrivateTempStoreFactory $temp_store_factory, StateInterface $state, ModuleHandlerInterface $module_handler) {
+ public function __construct(Connection $connection, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, QueryFactory $entity_query, LingotekInterface $lingotek, LingotekConfigurationServiceInterface $lingotek_configuration, LanguageLocaleMapperInterface $language_locale_mapper, ContentTranslationManagerInterface $content_translation_manager, LingotekContentTranslationServiceInterface $translation_service, PrivateTempStoreFactory $temp_store_factory, StateInterface $state, ModuleHandlerInterface $module_handler) {
+ $this->connection = $connection;
+ $this->connection = $connection;
+ $this->entityManager = $entity_manager;
+ $this->entityManager = $entity_manager;
+ $this->languageManager = $language_manager;
+ $this->languageManager = $language_manager;
+ $this->entityQuery = $entity_query;
+ $this->entityQuery = $entity_query;
+ $this->contentTranslationManager = $content_translation_manager;
+ $this->contentTranslationManager = $content_translation_manager;
+ $this->lingotek = $lingotek;
+ $this->lingotek = $lingotek;
+ $this->translationService = $translation_service;
+ $this->translationService = $translation_service;
+ $this->tempStoreFactory = $temp_store_factory;
+ $this->tempStoreFactory = $temp_store_factory;
+ $this->lingotek = $lingotek;
+ $this->lingotek = $lingotek;
+ $this->lingotekConfiguration = $lingotek_configuration;
+ $this->lingotekConfiguration = $lingotek_configuration;
+ $this->languageLocaleMapper = $language_locale_mapper;
+ $this->languageLocaleMapper = $language_locale_mapper;
+ $this->state = $state;
+ $this->state = $state;
+ $this->moduleHandler = $module_handler;
+ $this->moduleHandler = $module_handler;
+ }
+ }
+
+
+ /**
+ /**
+ * {@inheritdoc}
+ * {@inheritdoc}
+ */
+ */
+ public static function create(ContainerInterface $container) {
+ public static function create(ContainerInterface $container) {
+ return new static(
+ return new static(
+ $container->get('database'),
+ $container->get('database'),
+ $container->get('entity.manager'),
+ $container->get('entity.manager'),
+ $container->get('language_manager'),
+ $container->get('language_manager'),
+ $container->get('entity.query'),
+ $container->get('entity.query'),
+ $container->get('lingotek'),
+ $container->get('lingotek'),
+ $container->get('lingotek.configuration'),
+ $container->get('lingotek.configuration'),
+ $container->get('lingotek.language_locale_mapper'),
+ $container->get('lingotek.language_locale_mapper'),
+ $container->get('content_translation.manager'),
+ $container->get('content_translation.manager'),
+ $container->get('lingotek.content_translation'),
+ $container->get('lingotek.content_translation'),
+ $container->get('user.private_tempstore'),
+ $container->get('user.private_tempstore'),
+ $container->get('state'),
+ $container->get('state'),
+ $container->get('module_handler')
+ $container->get('module_handler')
+ );
+ );
+ }
+ }
+
+
+ protected function getEntities($values) {
+ protected function getEntities($values) {
+ $entityTypes = [];
+ $entityTypes = [];
+ $entities = [];
+ $entities = [];
+ foreach ($values as $type_entity_id) {
+ foreach ($values as $type_entity_id) {
+ list($type, $entity_id) = explode(":",$type_entity_id);
+ list($type, $entity_id) = explode(":",$type_entity_id);
+ $entityTypes[$type][] = $entity_id;
+ $entityTypes[$type][] = $entity_id;
+ }
+ }
+
+
+ foreach ($entityTypes as $type => $values) {
+ foreach ($entityTypes as $type => $values) {
+ $entities = array_merge($entities, $this->entityManager->getStorage($type)->loadMultiple($values));
+ $entities = array_merge($entities, $this->entityManager->getStorage($type)->loadMultiple($values));
+ }
+ }
+ return $entities;
+ return $entities;
+ }
+ }
+
+
+ /**
+ /**
+ * {@inheritdoc}
+ * {@inheritdoc}
+ */
+ */
+ public function getFormId() {
+ public function getFormId() {
+ return 'lingotek_management';
+ return 'lingotek_management';
+ }
+ }
+
+
+ /**
+ /**
+ * test
+ * test
+ */
+ */
+ public function getAllEntities(ContentEntityInterface &$entity, &$visited = [], &$entities = []) {
+ public function getAllEntities(ContentEntityInterface &$entity, &$visited = [], &$entities = []) {
+ // Logic adapted from Content Translation core module and TMGMT contrib
+ // Logic adapted from Content Translation core module and TMGMT contrib
+ // module for pulling translatable field info from content entities.
+ // module for pulling translatable field info from content entities.
+ $visited[$entity->bundle()][] = $entity->id();
+ $visited[$entity->bundle()][] = $entity->id();
+ $entities[$entity->getEntityTypeId()][$entity->id()] = $entity;
+ $entities[$entity->getEntityTypeId()][$entity->id()] = $entity;
+ $entity_type = $entity->getEntityType();
+ $entity_type = $entity->getEntityType();
+ $field_definitions = $this->entityManager->getFieldDefinitions($entity->getEntityTypeId(), $entity->bundle());
+ $field_definitions = $this->entityManager->getFieldDefinitions($entity->getEntityTypeId(), $entity->bundle());
+ $storage_definitions = $entity_type instanceof ContentEntityTypeInterface ? $this->entityManager->getFieldStorageDefinitions($entity_type->id()) : array();
+ $storage_definitions = $entity_type instanceof ContentEntityTypeInterface ? $this->entityManager->getFieldStorageDefinitions($entity_type->id()) : array();
+ $translatable_fields = array();
+ $translatable_fields = array();
+ // We need to include computed fields, as we may have a URL alias.
+ // We need to include computed fields, as we may have a URL alias.
+ foreach ($entity->getFields(TRUE) as $field_name => $definition) {
+ foreach ($entity->getFields(TRUE) as $field_name => $definition) {
+ if ($this->lingotekConfiguration->isFieldLingotekEnabled($entity->getEntityTypeId(), $entity->bundle(), $field_name)
+ if ($this->lingotekConfiguration->isFieldLingotekEnabled($entity->getEntityTypeId(), $entity->bundle(), $field_name)
+ && $field_name != $entity_type->getKey('langcode')
+ && $field_name != $entity_type->getKey('langcode')
+ && $field_name != $entity_type->getKey('default_langcode')) {
+ && $field_name != $entity_type->getKey('default_langcode')) {
+ $translatable_fields[$field_name] = $definition;
+ $translatable_fields[$field_name] = $definition;
+ }
+ }
+ }
+ }
+ $source_entity = $entity->getUntranslated();
+ $source_entity = $entity->getUntranslated();
+ foreach ($translatable_fields as $k => $definition) {
+ foreach ($translatable_fields as $k => $definition) {
+ // If there is only one relevant attribute, upload it.
+ // If there is only one relevant attribute, upload it.
+ // Get the column translatability configuration.
+ // Get the column translatability configuration.
+ module_load_include('inc', 'content_translation', 'content_translation.admin');
+ module_load_include('inc', 'content_translation', 'content_translation.admin');
+ $column_element = content_translation_field_sync_widget($field_definitions[$k]);
+ $column_element = content_translation_field_sync_widget($field_definitions[$k]);
+ $field = $source_entity->get($k);
+ $field = $source_entity->get($k);
+ $field_type = $field_definitions[$k]->getType();
+ $field_type = $field_definitions[$k]->getType();
+
+
+ // If we have an entity reference, we may want to embed it.
+ // If we have an entity reference, we may want to embed it.
+ if ($field_type === 'entity_reference' || $field_type === 'er_viewmode') {
+ if ($field_type === 'entity_reference' || $field_type === 'er_viewmode') {
+ $target_entity_type_id = $field_definitions[$k]->getFieldStorageDefinition()->getSetting('target_type');
+ $target_entity_type_id = $field_definitions[$k]->getFieldStorageDefinition()->getSetting('target_type');
+ foreach ($entity->{$k} as $field_item) {
+ foreach ($entity->{$k} as $field_item) {
+ $embedded_entity_id = $field_item->get('target_id')->getValue();
+ $embedded_entity_id = $field_item->get('target_id')->getValue();
+ $embedded_entity = $this->entityManager->getStorage($target_entity_type_id)->load($embedded_entity_id);
+ $embedded_entity = $this->entityManager->getStorage($target_entity_type_id)->load($embedded_entity_id);
+ // We may have orphan references, so ensure that they exist before
+ // We may have orphan references, so ensure that they exist before
+ // continuing.
+ // continuing.
+ if ($embedded_entity !== NULL) {
+ if ($embedded_entity !== NULL) {
+ if ($embedded_entity instanceof ContentEntityInterface) {
+ if ($embedded_entity instanceof ContentEntityInterface) {
+ // We need to avoid cycles if we have several entity references
+ // We need to avoid cycles if we have several entity references
+ // referencing each other.
+ // referencing each other.
+ if (!isset($visited[$embedded_entity->bundle()]) || !in_array($embedded_entity->id(), $visited[$embedded_entity->bundle()])) {
+ if (!isset($visited[$embedded_entity->bundle()]) || !in_array($embedded_entity->id(), $visited[$embedded_entity->bundle()])) {
+ $this->getAllEntities($embedded_entity, $visited, $entities);
+ $this->getAllEntities($embedded_entity, $visited, $entities);
+ }
+ }
+ }
+ }
+ elseif ($embedded_entity instanceof ConfigEntityInterface) {
+ elseif ($embedded_entity instanceof ConfigEntityInterface) {
+ $entities[$embedded_entity->getEntityTypeId()][$embedded_entity->id()] = $embedded_entity;
+ $entities[$embedded_entity->getEntityTypeId()][$embedded_entity->id()] = $embedded_entity;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ // Paragraphs use the entity_reference_revisions field type.
+ // Paragraphs use the entity_reference_revisions field type.
+ elseif ($field_type === 'entity_reference_revisions') {
+ elseif ($field_type === 'entity_reference_revisions') {
+ $target_entity_type_id = $field_definitions[$k]->getFieldStorageDefinition()->getSetting('target_type');
+ $target_entity_type_id = $field_definitions[$k]->getFieldStorageDefinition()->getSetting('target_type');
+ foreach ($entity->{$k} as $field_item) {
+ foreach ($entity->{$k} as $field_item) {
+ $embedded_entity_id = $field_item->get('target_id')->getValue();
+ $embedded_entity_id = $field_item->get('target_id')->getValue();
+ $embedded_entity_revision_id = $field_item->get('target_revision_id')->getValue();
+ $embedded_entity_revision_id = $field_item->get('target_revision_id')->getValue();
+ $embedded_entity = $this->entityManager->getStorage($target_entity_type_id)->loadRevision($embedded_entity_revision_id);
+ $embedded_entity = $this->entityManager->getStorage($target_entity_type_id)->loadRevision($embedded_entity_revision_id);
+ // $entities[$entity->id()]['children'][] = getAllEntities($embedded_entity, $visited);
+ // $entities[$entity->id()]['children'][] = getAllEntities($embedded_entity, $visited);
+ $this->getAllEntities($embedded_entity, $visited, $entities);
+ $this->getAllEntities($embedded_entity, $visited, $entities);
+ }
+ }
+ }
+ }
+ }
+ }
+ return $entities;
+ return $entities;
+ }
+ }
+
+
+ /**
+ /**
+ * {@inheritdoc}
+ * {@inheritdoc}
+ */
+ */
+ public function buildForm(array $form, FormStateInterface $form_state) {
+ public function buildForm(array $form, FormStateInterface $form_state, ContentEntityInterface $node = null) {
+ if ($redirect = $this->checkSetup()) {
+ if ($redirect = $this->checkSetup()) {
+ return $redirect;
+ return $redirect;
+ }
+ }
+
+
+ $parameters = \Drupal::routeMatch()->getParameters()->all();
+ $parameters = \Drupal::routeMatch()->getParameters()->all();
+ $content_type = array_keys($parameters)[0];
+ $content_type = array_keys($parameters)[0];
+
+
+ $allEntities = $this->getAllEntities(\Drupal::entityTypeManager()->getStorage($content_type)->load($parameters[$content_type]));
+ $allEntities = $this->getAllEntities($node);
+
+
+ $rows = [];
+ $rows = [];
+ $counter = 1;
+ $counter = 1;
+ if (!empty($allEntities)) {
+ if (!empty($allEntities)) {
+ foreach ($allEntities as $entity_type_id => $entities) {
+ foreach ($allEntities as $entity_type_id => $entities) {
+ $entity_type = $this->entityManager->getDefinition($entity_type_id);
+ $entity_type = $this->entityManager->getDefinition($entity_type_id);
+ foreach ($entities as $entity_id => $entity) {
+ foreach ($entities as $entity_id => $entity) {
+ $source = $this->getSourceStatus($entity);
+ $source = $this->getSourceStatus($entity);
+ $translations = $this->getTranslationsStatuses($entity);
+ $translations = $this->getTranslationsStatuses($entity);
+ $profile = $this->lingotekConfiguration->getEntityProfile($entity, TRUE);
+ $profile = $this->lingotekConfiguration->getEntityProfile($entity, TRUE);
+ $form['table'][(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()] = [
+ $form['table'][(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()] = [
+ '#type' => 'checkbox',
+ '#type' => 'checkbox',
+ '#value' => $entity->id()
+ '#value' => $entity->id()
+ ];
+ ];
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()] = [];
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()] = [];
+ if ($has_bundles) {
+ if ($has_bundles) {
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()]['bundle'] = $this->entityManager->getBundleInfo($entity->getEntityTypeId())[$entity->bundle()]['label'];
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()]['bundle'] = $this->entityManager->getBundleInfo($entity->getEntityTypeId())[$entity->bundle()]['label'];
+ }
+ }
+
+
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()] += [
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()] += [
+ 'title' => $entity->hasLinkTemplate('canonical') ? $this->getLinkGenerator()
+ 'title' => $entity->hasLinkTemplate('canonical') ? $this->getLinkGenerator()
+ ->generate($entity->label(), Url::fromRoute($entity->urlInfo()
+ ->generate($entity->label(), Url::fromRoute($entity->urlInfo()
+ ->getRouteName(), [$entity_type_id => $entity->id()])) : $entity->id(),
+ ->getRouteName(), [$entity_type_id => $entity->id()])) : $entity->id(),
+ 'source' => $source,
+ 'source' => $source,
+ 'translations' => $translations,
+ 'translations' => $translations,
+ 'profile' => $profile ? $profile->label() : '',
+ 'profile' => $profile ? $profile->label() : '',
+ ];
+ ];
+ if (!$this->lingotekConfiguration->isEnabled($entity->getEntityTypeId(), $entity->bundle())) {
+ if (!$this->lingotekConfiguration->isEnabled($entity->getEntityTypeId(), $entity->bundle())) {
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()]['profile'] = 'Not enabled';
+ $rows[(String)$entity->getEntityTypeId() . ':' . (String)$entity->id()]['profile'] = 'Not enabled';
+ }
+ }
+ $counter += 1;
+ $counter += 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ $headers = [];
+ $headers = [];
+ if ($has_bundles) {
+ if ($has_bundles) {
+ $headers['bundle'] = $entity_type->getBundleLabel();
+ $headers['bundle'] = $entity_type->getBundleLabel();
+ }
+ }
+ $headers += [
+ $headers += [
+ 'title' => $has_bundles && $entity_type->hasKey('label') ? $properties[$entity_type->getKey('label')]->getLabel() : $entity_type->getLabel(),
+ 'title' => $has_bundles && $entity_type->hasKey('label') ? $properties[$entity_type->getKey('label')]->getLabel() : $entity_type->getLabel(),
+ 'source' => $this->t('Source'),
+ 'source' => $this->t('Source'),
+ 'translations' => $this->t('Translations'),
+ 'translations' => $this->t('Translations'),
+ 'profile' => $this->t('Profile'),
+ 'profile' => $this->t('Profile'),
+ ];
+ ];
+
+
+ // Build an 'Update options' form.
+ // Build an 'Update options' form.
+ $form['options'] = array(
+ $form['options'] = array(
+ '#type' => 'details',
+ '#type' => 'details',
+ '#title' => $this->t('Bulk document management'),
+ '#title' => $this->t('Bulk document management'),
+ '#open' => TRUE,
+ '#open' => TRUE,
+ '#attributes' => array('class' => array('container-inline')),
+ '#attributes' => array('class' => array('container-inline')),
+ '#weight' => 10,
+ '#weight' => 10,
+ );
+ );
+ $form['options']['operation'] = array(
+ $form['options']['operation'] = array(
+ '#type' => 'select',
+ '#type' => 'select',
+ '#title' => $this->t('Action'),
+ '#title' => $this->t('Action'),
+ '#title_display' => 'invisible',
+ '#title_display' => 'invisible',
+ '#options' => $this->generateBulkOptions(),
+ '#options' => $this->generateBulkOptions(),
+ );
+ );
+ $form['options']['submit'] = array(
+ $form['options']['submit'] = array(
+ '#type' => 'submit',
+ '#type' => 'submit',
+ '#value' => $this->t('Execute'),
+ '#value' => $this->t('Execute'),
+ );
+ );
+
+
+ $form['table'] = [
+ $form['table'] = [
+ '#header' => $headers,
+ '#header' => $headers,
+ '#options' => $rows,
+ '#options' => $rows,
+ '#empty' => $this->t('No content available'),
+ '#empty' => $this->t('No content available'),
+ '#type' => 'tableselect',
+ '#type' => 'tableselect',
+ '#weight' => 30,
+ '#weight' => 30,
+ ];
+ ];
+ $form['#attached']['library'][] = 'lingotek/lingotek';
+ $form['#attached']['library'][] = 'lingotek/lingotek';
+ $form['#attached']['library'][] = 'lingotek/lingotek.manage';
+ $form['#attached']['library'][] = 'lingotek/lingotek.manage';
+ return $form;
+ return $form;
+ }
+ }
+
+
+ /**
+ /**
+ * {@inheritdoc}
+ * {@inheritdoc}
+ */
+ */
+ public function submitForm(array &$form, FormStateInterface $form_state) {
+ public function submitForm(array &$form, FormStateInterface $form_state) {
+ $operation = $form_state->getValue('operation');
+ $operation = $form_state->getValue('operation');
+ $values = array_keys(array_filter($form_state->getValue(['table'], function($key, $value){ return $value; })));
+ $values = array_keys(array_filter($form_state->getValue(['table'], function($key, $value){ return $value; })));
+ $processed = FALSE;
+ $processed = FALSE;
+ switch ($operation) {
+ switch ($operation) {
+ case 'debug.export':
+ case 'debug.export':
+ $this->createDebugExportBatch($values);
+ $this->createDebugExportBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'upload':
+ case 'upload':
+ $this->createUploadBatch($values);
+ $this->createUploadBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'check_upload':
+ case 'check_upload':
+ $this->createUploadCheckStatusBatch($values);
+ $this->createUploadCheckStatusBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'request_translations':
+ case 'request_translations':
+ $this->createRequestTranslationsBatch($values);
+ $this->createRequestTranslationsBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'check_translations':
+ case 'check_translations':
+ $this->createTranslationCheckStatusBatch($values);
+ $this->createTranslationCheckStatusBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'download':
+ case 'download':
+ $this->createDownloadBatch($values);
+ $this->createDownloadBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'disassociate':
+ case 'disassociate':
+ $this->createDisassociateBatch($values);
+ $this->createDisassociateBatch($values);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ case 'delete_nodes':
+ case 'delete_nodes':
+ $this->redirectToDeleteMultipleNodesForm($values, $form_state);
+ $this->redirectToDeleteMultipleNodesForm($values, $form_state);
+ $processed = TRUE;
+ $processed = TRUE;
+ break;
+ break;
+ }
+ }
+ if (!$processed) {
+ if (!$processed) {
+ if (0 === strpos($operation, 'request_translation:')) {
+ if (0 === strpos($operation, 'request_translation:')) {
+ list($operation, $language) = explode(':', $operation);
+ list($operation, $language) = explode(':', $operation);
+ $this->createLanguageRequestTranslationBatch($values, $language);
+ $this->createLanguageRequestTranslationBatch($values, $language);
+ $processed = TRUE;
+ $processed = TRUE;
+ }
+ }
+ if (0 === strpos($operation, 'check_translation:')) {
+ if (0 === strpos($operation, 'check_translation:')) {
+ list($operation, $language) = explode(':', $operation);
+ list($operation, $language) = explode(':', $operation);
+ $this->createLanguageTranslationCheckStatusBatch($values, $language);
+ $this->createLanguageTranslationCheckStatusBatch($values, $language);
+ $processed = TRUE;
+ $processed = TRUE;
+ }
+ }
+ if (0 === strpos($operation, 'download:')) {
+ if (0 === strpos($operation, 'download:')) {
+ list($operation, $language) = explode(':', $operation);
+ list($operation, $language) = explode(':', $operation);
+ $this->createLanguageDownloadBatch($values, $language);
+ $this->createLanguageDownloadBatch($values, $language);
+ $processed = TRUE;
+ $processed = TRUE;
+ }
+ }
+ if (0 === strpos($operation, 'change_profile:')) {
+ if (0 === strpos($operation, 'change_profile:')) {
+ list($operation, $profile_id) = explode(':', $operation);
+ list($operation, $profile_id) = explode(':', $operation);
+ $this->createChangeProfileBatch($values, $profile_id);
+ $this->createChangeProfileBatch($values, $profile_id);
+ $processed = TRUE;
+ $processed = TRUE;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+}
diff --git a/src/Form/LingotekManagementForm.php b/src/Form/LingotekManagementForm.php
diff --git a/src/Form/LingotekManagementForm.php b/src/Form/LingotekManagementForm.php
index 9336b6e..9eb8bfb 100644
index 9336b6e..9eb8bfb 100644
--- a/src/Form/LingotekManagementForm.php
--- a/src/Form/LingotekManagementForm.php
+++ b/src/Form/LingotekManagementForm.php
+++ b/src/Form/LingotekManagementForm.php
@@ -7,37 +7,24 @@
@@ -7,37 +7,24 @@
namespace Drupal\lingotek\Form;
namespace Drupal\lingotek\Form;
+use Drupal\lingotek\Form\LingotekManagementFormBase;
+use Drupal\lingotek\Form\LingotekManagementFormBase;
use Drupal\content_translation\ContentTranslationManagerInterface;
use Drupal\content_translation\ContentTranslationManagerInterface;
-use Drupal\Core\Ajax\AjaxResponse;
-use Drupal\Core\Ajax\AjaxResponse;
-use Drupal\Core\Ajax\InvokeCommand;
-use Drupal\Core\Ajax\InvokeCommand;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Connection;
-use Drupal\Core\Entity\ContentEntityInterface;
-use Drupal\Core\Entity\ContentEntityInterface;
-use Drupal\Core\Entity\Entity;
-use Drupal\Core\Entity\Entity;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Form\FormBase;
-use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Language\LanguageManagerInterface;
-use Drupal\Core\Routing\LocalRedirectResponse;
-use Drupal\Core\Routing\LocalRedirectResponse;
use Drupal\Core\State\StateInterface;
use Drupal\Core\State\StateInterface;
use Drupal\Core\Url;
use Drupal\Core\Url;
-use Drupal\file\Entity\File;
-use Drupal\file\Entity\File;
use Drupal\group\Entity\Group;
use Drupal\group\Entity\Group;
-use Drupal\group\Entity\GroupInterface;
-use Drupal\group\Entity\GroupInterface;
use Drupal\group\Plugin\GroupContentEnablerManagerInterface;
use Drupal\group\Plugin\GroupContentEnablerManagerInterface;
-use Drupal\language\Entity\ConfigurableLanguage;
-use Drupal\language\Entity\ConfigurableLanguage;
-use Drupal\lingotek\Exception\LingotekApiException;
-use Drupal\lingotek\Exception\LingotekApiException;
-use Drupal\lingotek\Exception\LingotekContentEntityStorageException;
-use Drupal\lingotek\Exception\LingotekContentEntityStorageException;
-use Drupal\lingotek\Helpers\LingotekManagementFormHelperTrait;
-use Drupal\lingotek\Helpers\LingotekManagementFormHelperTrait;
use Drupal\lingotek\LanguageLocaleMapperInterface;
use Drupal\lingotek\LanguageLocaleMapperInterface;
use Drupal\lingotek\Lingotek;
use Drupal\lingotek\Lingotek;
use Drupal\lingotek\LingotekConfigurationServiceInterface;
use Drupal\lingotek\LingotekConfigurationServiceInterface;
use Drupal\lingotek\LingotekContentTranslationServiceInterface;
use Drupal\lingotek\LingotekContentTranslationServiceInterface;
use Drupal\lingotek\LingotekInterface;
use Drupal\lingotek\LingotekInterface;
-use Drupal\lingotek\LingotekLocale;
-use Drupal\lingotek\LingotekLocale;
-use Drupal\lingotek\LingotekSetupTrait;
-use Drupal\lingotek\LingotekSetupTrait;
use Drupal\user\PrivateTempStore;
use Drupal\user\PrivateTempStore;
use Drupal\user\PrivateTempStoreFactory;
use Drupal\user\PrivateTempStoreFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -45,88 +32,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -45,88 +32,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
/**
/**
* Form for bulk management of content.
* Form for bulk management of content.
*/
*/
-class LingotekManagementForm extends FormBase {
-class LingotekManagementForm extends FormBase {
-
-
- use LingotekSetupTrait;
- use LingotekSetupTrait;
-
-
- use LingotekManagementFormHelperTrait;
- use LingotekManagementFormHelperTrait;
-
-
- /**
- /**
- * The connection object on which to run queries.
- * The connection object on which to run queries.
- *
- *
- * @var \Drupal\Core\Database\Connection
- * @var \Drupal\Core\Database\Connection
- */
- */
- protected $connection;
- protected $connection;
-
-
- /**
- /**
- * The language-locale mapper.
- * The language-locale mapper.
- *
- *
- * @var \Drupal\lingotek\LanguageLocaleMapperInterface
- * @var \Drupal\lingotek\LanguageLocaleMapperInterface
- */
- */
- protected $languageLocaleMapper;
- protected $languageLocaleMapper;
-
-
- /**
- /**
- * The entity manager.
- * The entity manager.
- *
- *
- * @var \Drupal\Core\Entity\EntityManagerInterface
- * @var \Drupal\Core\Entity\EntityManagerInterface
- */
- */
- protected $entityManager;
- protected $entityManager;
-
-
- /**
- /**
- * The language manager.
- * The language manager.
- *
- *
- * @var \Drupal\Core\Language\LanguageManagerInterface
- * @var \Drupal\Core\Language\LanguageManagerInterface
- */
- */
- protected $languageManager;
- protected $languageManager;
-
-
- /**
- /**
- * The entity query factory service.
- * The entity query factory service.
- *
- *
- * @var \Drupal\Core\Entity\Query\QueryFactory
- * @var \Drupal\Core\Entity\Query\QueryFactory
- */
- */
- protected $entityQuery;
- protected $entityQuery;
-
-
- /**
- /**
- * The Lingotek configuration service.
- * The Lingotek configuration service.
- *
- *
- * @var \Drupal\lingotek\LingotekConfigurationServiceInterface
- * @var \Drupal\lingotek\LingotekConfigurationServiceInterface
- */
- */
- protected $lingotekConfiguration;
- protected $lingotekConfiguration;
-
-
- /**
- /**
- * The content translation manager.
- * The content translation manager.
- *
- *
- * @var \Drupal\content_translation\ContentTranslationManagerInterface
- * @var \Drupal\content_translation\ContentTranslationManagerInterface
- */
- */
- protected $contentTranslationManager;
- protected $contentTranslationManager;
-
-
- /**
- /**
- * The Lingotek content translation service.
- * The Lingotek content translation service.
- *
- *
- * @var \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service
- * @var \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service
- */
- */
- protected $translationService;
- protected $translationService;
-
-
- /**
- /**
- * The state key value store.
- * The state key value store.
- *
- *
- * @var \Drupal\Core\State\StateInterface
- * @var \Drupal\Core\State\StateInterface
- */
- */
- protected $state;
- protected $state;
-
-
- /**
- /**
- * The module handler.
- * The module handler.
- *
- *
- * @var \Drupal\Core\Extension\ModuleHandlerInterface
- * @var \Drupal\Core\Extension\ModuleHandlerInterface
- */
- */
- protected $moduleHandler;
- protected $moduleHandler;
-
-
- /**
- /**
- * The entity type id.
- * The entity type id.
- *
- *
- * @var string
- * @var string
- */
- */
- protected $entityTypeId;
- protected $entityTypeId;
+class LingotekManagementForm extends LingotekManagementFormBase {
+class LingotekManagementForm extends LingotekManagementFormBase {
/**
/**
* Constructs a new LingotekManagementForm object.
* Constructs a new LingotekManagementForm object.
@@ -192,6 +98,10 @@ class LingotekManagementForm extends FormBase {
@@ -192,6 +98,10 @@ class LingotekManagementForm extends FormBase {
);
);
}
}
+ protected function getEntities($values) {
+ protected function getEntities($values) {
+ return $this->entityManager->getStorage($this->entityTypeId)->loadMultiple($values);
+ return $this->entityManager->getStorage($this->entityTypeId)->loadMultiple($values);
+ }
+ }
+
+
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
@@ -431,13 +341,6 @@ class LingotekManagementForm extends FormBase {
@@ -431,13 +341,6 @@ class LingotekManagementForm extends FormBase {
return $form;
return $form;
}
}
- public function itemsPerPageCallback(array &$form, FormStateInterface $form_state) {
- public function itemsPerPageCallback(array &$form, FormStateInterface $form_state) {
- $ajax_response = new AjaxResponse();
- $ajax_response = new AjaxResponse();
- $this->setItemsPerPage($form_state->getValue('items_per_page'));
- $this->setItemsPerPage($form_state->getValue('items_per_page'));
- $ajax_response->addCommand(new InvokeCommand('#lingotek-management', 'submit'));
- $ajax_response->addCommand(new InvokeCommand('#lingotek-management', 'submit'));
- return $ajax_response;
- return $ajax_response;
- }
- }
-
-
/**
/**
* Form submission handler for resetting the filters.
* Form submission handler for resetting the filters.
*
*
@@ -546,835 +449,4 @@ class LingotekManagementForm extends FormBase {
@@ -546,835 +449,4 @@ class LingotekManagementForm extends FormBase {
}
}
}
}
}
}
-
-
- /**
- /**
- * Performs an operation to several values in a batch.
- * Performs an operation to several values in a batch.
- *
- *
- * @param string $operation
- * @param string $operation
- * The method in this object we need to call.
- * The method in this object we need to call.
- * @param array $values
- * @param array $values
- * Array of ids to process.
- * Array of ids to process.
- * @param string $title
- * @param string $title
- * The title for the batch progress.
- * The title for the batch progress.
- * @param string $language
- * @param string $language
- * The language code for the request. NULL if is not applicable.
- * The language code for the request. NULL if is not applicable.
- */
- */
- protected function createBatch($operation, $values, $title, $language = NULL) {
- protected function createBatch($operation, $values, $title, $language = NULL) {
- $operations = [];
- $operations = [];
- $entities = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple($values);
- $entities = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple($values);
-
-
- foreach ($entities as $entity) {
- foreach ($entities as $entity) {
- $operations[] = [[$this, $operation], [$entity, $language]];
- $operations[] = [[$this, $operation], [$entity, $language]];
- }
- }
- $batch = array(
- $batch = array(
- 'title' => $title,
- 'title' => $title,
- 'operations' => $operations,
- 'operations' => $operations,
- 'finished' => [$this, 'batchFinished'],
- 'finished' => [$this, 'batchFinished'],
- 'progressive' => TRUE,
- 'progressive' => TRUE,
- 'batch_redirect' => $this->getRequest()->getUri(),
- 'batch_redirect' => $this->getRequest()->getUri(),
- );
- );
- batch_set($batch);
- batch_set($batch);
- }
- }
-
-
-
-
- public function batchFinished($success, $results, $operations) {
- public function batchFinished($success, $results, $operations) {
- if ($success) {
- if ($success) {
- $batch = &batch_get();
- $batch = &batch_get();
- drupal_set_message('Operations completed.');
- drupal_set_message('Operations completed.');
- }
- }
- return new LocalRedirectResponse($batch['sets'][0]['batch_redirect']);
- return new LocalRedirectResponse($batch['sets'][0]['batch_redirect']);
- }
- }
-
-
- /**
- /**
- * Create and set an upload batch.
- * Create and set an upload batch.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- */
- */
- protected function createUploadBatch($values) {
- protected function createUploadBatch($values) {
- $this->createBatch('uploadDocument', $values, $this->t('Uploading content to Lingotek service'));
- $this->createBatch('uploadDocument', $values, $this->t('Uploading content to Lingotek service'));
- }
- }
-
-
- /**
- /**
- * Create and set an export batch.
- * Create and set an export batch.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- */
- */
- protected function createDebugExportBatch($values) {
- protected function createDebugExportBatch($values) {
- $entities = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple($values);
- $entities = $this->entityManager->getStorage($this->entityTypeId)->loadMultiple($values);
-
-
- foreach ($entities as $entity) {
- foreach ($entities as $entity) {
- $operations[] = [[$this, 'debugExport'], [$entity]];
- $operations[] = [[$this, 'debugExport'], [$entity]];
- }
- }
- $batch = array(
- $batch = array(
- 'title' => $this->t('Exporting content (debugging purposes)'),
- 'title' => $this->t('Exporting content (debugging purposes)'),
- 'operations' => $operations,
- 'operations' => $operations,
- 'finished' => [$this, 'debugExportFinished'],
- 'finished' => [$this, 'debugExportFinished'],
- 'progressive' => TRUE,
- 'progressive' => TRUE,
- );
- );
- batch_set($batch);
- batch_set($batch);
- }
- }
-
-
- public function debugExportFinished($success, $results, $operations) {
- public function debugExportFinished($success, $results, $operations) {
- if ($success) {
- if ($success) {
- $links = [];
- $links = [];
- foreach ($results['exported'] as $result) {
- foreach ($results['exported'] as $result) {
- $links[] = [
- $links[] = [
- '#theme' => 'file_link',
- '#theme' => 'file_link',
- '#file' => File::load($result),
- '#file' => File::load($result),
- ];
- ];
- }
- }
- $build = [
- $build = [
- '#theme' => 'item_list',
- '#theme' => 'item_list',
- '#items' => $links,
- '#items' => $links,
- ];
- ];
- drupal_set_message($this->t('Exports available at: @exports',
- drupal_set_message($this->t('Exports available at: @exports',
- ['@exports' => drupal_render($build)]));
- ['@exports' => drupal_render($build)]));
- }
- }
- }
- }
-
-
-
-
- /**
- /**
- * Create and set a check upload status batch.
- * Create and set a check upload status batch.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- */
- */
- protected function createUploadCheckStatusBatch($values) {
- protected function createUploadCheckStatusBatch($values) {
- $this->createBatch('checkDocumentUploadStatus', $values, $this->t('Checking content upload status with the Lingotek service'));
- $this->createBatch('checkDocumentUploadStatus', $values, $this->t('Checking content upload status with the Lingotek service'));
- }
- }
-
-
- /**
- /**
- * Create and set a request translations batch for all languages.
- * Create and set a request translations batch for all languages.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- */
- */
- protected function createRequestTranslationsBatch($values) {
- protected function createRequestTranslationsBatch($values) {
- $this->createBatch('requestTranslations', $values, $this->t('Requesting translations to Lingotek service.'));
- $this->createBatch('requestTranslations', $values, $this->t('Requesting translations to Lingotek service.'));
- }
- }
-
-
- /**
- /**
- * Create and set a request translations batch for all languages.
- * Create and set a request translations batch for all languages.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- * @param string $language
- * @param string $language
- * Language code for the request.
- * Language code for the request.
- */
- */
- protected function createLanguageRequestTranslationBatch($values, $language) {
- protected function createLanguageRequestTranslationBatch($values, $language) {
- $this->createBatch('requestTranslation', $values, $this->t('Requesting translations to Lingotek service.'), $language);
- $this->createBatch('requestTranslation', $values, $this->t('Requesting translations to Lingotek service.'), $language);
- }
- }
-
-
- /**
- /**
- * Create and set a check translation status batch for all languages.
- * Create and set a check translation status batch for all languages.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- */
- */
- protected function createTranslationCheckStatusBatch($values) {
- protected function createTranslationCheckStatusBatch($values) {
- $this->createBatch('checkTranslationStatuses', $values, $this->t('Checking translations status from the Lingotek service.'));
- $this->createBatch('checkTranslationStatuses', $values, $this->t('Checking translations status from the Lingotek service.'));
- }
- }
-
-
- /**
- /**
- * Create and set a check translation status batch for a given language.
- * Create and set a check translation status batch for a given language.
- *
- *
- * @param array $values
- * @param array $values
- * Array of ids to upload.
- * Array of ids to upload.
- * @para
- * @param string $language
- * Language code for th