You are here

class Translator in Translation Management Tool 8

Same name in this branch
  1. 8 src/Entity/Translator.php \Drupal\tmgmt\Entity\Translator
  2. 8 src/Plugin/views/field/Translator.php \Drupal\tmgmt\Plugin\views\field\Translator

Entity class for the tmgmt_translator entity.

For disambiguation, The UI uses the term "Provider" for a translator.

Plugin annotation


@ConfigEntityType(
  id = "tmgmt_translator",
  label = @Translation("Provider"),
  handlers = {
    "form" = {
      "edit" = "Drupal\tmgmt\Form\TranslatorForm",
      "add" = "Drupal\tmgmt\Form\TranslatorForm",
      "delete" = "\Drupal\Core\Entity\EntityDeleteForm",
      "clone" = "Drupal\tmgmt\Form\TranslatorForm",
    },
    "list_builder" = "Drupal\tmgmt\Entity\ListBuilder\TranslatorListBuilder",
    "access" = "Drupal\tmgmt\Entity\Controller\TranslatorAccessControlHandler",
  },
  uri_callback = "tmgmt_translator_uri",
  config_prefix = "translator",
  entity_keys = {
    "id" = "name",
    "label" = "label",
    "weight" = "weight",
  },
  config_export = {
    "name",
    "label",
    "description",
    "auto_accept",
    "weight",
    "plugin",
    "settings",
    "remote_languages_mappings",
  },
  links = {
    "collection" = "/admin/tmgmt/translators",
    "edit-form" = "/admin/tmgmt/translator/manage/{tmgmt_translator}",
    "add-form" = "/admin/tmgmt/translators/add",
    "delete-form" = "/admin/tmgmt/translators/manage/{tmgmt_translator}/delete",
    "clone-form" = "/admin/tmgmt/translators/manage/{tmgmt_translator}/clone",
  }
)

Hierarchy

Expanded class hierarchy of Translator

Related topics

15 files declare their use of Translator
ContentEntitySourceUnitTest.php in sources/content/tests/src/Kernel/ContentEntitySourceUnitTest.php
ContentTmgmtEntitySourceUiTest.php in sources/content/tests/src/Functional/ContentTmgmtEntitySourceUiTest.php
CrudTest.php in tests/src/Kernel/CrudTest.php
FileTranslatorTest.php in translators/tmgmt_file/tests/src/Functional/FileTranslatorTest.php
LocalTranslatorPreviewTest.php in translators/tmgmt_local/tests/src/Functional/LocalTranslatorPreviewTest.php

... See full list

File

src/Entity/Translator.php, line 60

Namespace

Drupal\tmgmt\Entity
View source
class Translator extends ConfigEntityBase implements TranslatorInterface {

  /**
   * Machine readable name of the translator.
   *
   * @var string
   */
  protected $name;

  /**
   * The UUID of this translator.
   *
   * @var string
   */
  protected $uuid;

  /**
   * Label of the translator.
   *
   * @var string
   */
  protected $label;

  /**
   * Description of the translator.
   *
   * @var string
   */
  protected $description;

  /**
   * Weight of the translator.
   *
   * @var int
   */
  protected $weight;

  /**
   * Plugin name of the translator.
   *
   * @type string
   */
  protected $plugin;

  /**
   * Translator type specific settings.
   *
   * @var array
   */
  protected $settings = array();

  /**
   * Whether to skip reviewing process and auto accepting translation.
   *
   * @var bool
   */
  protected $auto_accept;

  /**
   * The supported target languages caches.
   *
   * @var array
   */
  protected $languageCache;

  /**
   * The supported language pairs caches.
   *
   * @var array
   */
  protected $languagePairsCache;

  /**
   * The supported remote languages caches.
   *
   * @var array
   */
  protected $remoteLanguages = [];

  /**
   * Whether the language cache in the database is outdated.
   *
   * @var bool
   */
  protected $languageCacheOutdated;

  /**
   * The remote languages mappings.
   *
   * @var array
   */
  protected $remote_languages_mappings = array();

  /**
   * {@inheritdoc}
   */
  public function id() {
    return $this->name;
  }

  /**
   * {@inheritdoc}
   */
  public function getSettings() {
    return $this->settings;
  }

  /**
   * {@inheritdoc}
   */
  public function setSettings(array $settings) {
    $this->settings = $settings;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getSetting($name) {
    if (is_array($name)) {
      if (NestedArray::keyExists($this->settings, $name)) {
        return NestedArray::getValue($this->settings, $name);
      }
      elseif ($plugin = $this
        ->getPlugin()) {
        $defaults = $plugin
          ->defaultSettings();
        return NestedArray::getValue($defaults, $name);
      }
    }
    else {
      if (isset($this->settings[$name])) {
        return $this->settings[$name];
      }
      elseif ($plugin = $this
        ->getPlugin()) {
        $defaults = $plugin
          ->defaultSettings();
        if (isset($defaults[$name])) {
          return $defaults[$name];
        }
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function setSetting($setting_name, $value) {
    NestedArray::setValue($this->settings, (array) $setting_name, $value);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function isAutoAccept() {
    return $this->auto_accept;
  }

  /**
   * {@inheritdoc}
   */
  public function setAutoAccept($value) {
    $this->auto_accept = $value;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getPluginId() {
    return $this->plugin;
  }

  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return $this->description;
  }

  /**
   * {@inheritdoc}
   */
  public function setPluginID($plugin_id) {
    $this->plugin = $plugin_id;
  }

  /**
   * {@inheritdoc}
   */
  public static function preDelete(EntityStorageInterface $storage, array $entities) {

    // We are never going to have many entities here, so we can risk a loop.
    foreach ($entities as $key => $name) {

      // Find active jobs associated with the translator that is being deleted.
      $job_ids = \Drupal::entityQuery('tmgmt_job')
        ->condition('state', [
        Job::STATE_ACTIVE,
        Job::STATE_CONTINUOUS,
        Job::STATE_UNPROCESSED,
      ], 'IN')
        ->condition('translator', $key)
        ->execute();
      $jobs = Job::loadMultiple($job_ids);

      /** @var \Drupal\tmgmt\JobInterface $job */
      foreach ($jobs as $job) {
        $job
          ->aborted('Job has been aborted because the translation provider %provider was deleted.', [
          '%provider' => $job
            ->getTranslatorLabel(),
        ]);
      }
    }
    parent::preDelete($storage, $entities);
  }

  /**
   * {@inheritdoc}
   */
  public function getPlugin() {
    return \Drupal::service('plugin.manager.tmgmt.translator')
      ->createInstance($this->plugin);
  }

  /**
   * {@inheritdoc}
   */
  public function hasPlugin() {
    if (!empty($this->plugin) && \Drupal::service('plugin.manager.tmgmt.translator')
      ->hasDefinition($this->plugin)) {
      return TRUE;
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getSupportedTargetLanguages($source_language) {
    if ($plugin = $this
      ->getPlugin()) {
      $info = $plugin
        ->getPluginDefinition();
      if (isset($info['language_cache']) && empty($info['language_cache'])) {

        // This plugin doesn't support language caching.
        return $this
          ->mapToLocalLanguages($plugin
          ->getSupportedTargetLanguages($this, $this
          ->mapToRemoteLanguage($source_language)));
      }
      else {

        // Retrieve the supported languages from the cache.
        if (empty($this->languageCache) && ($cache = \Drupal::cache('data')
          ->get('tmgmt_languages:' . $this->name))) {
          $this->languageCache = $cache->data;
        }

        // Even if we successfully queried the cache it might not have an entry
        // for our source language yet.
        if (!isset($this->languageCache[$source_language])) {
          $local_languages = $this
            ->mapToLocalLanguages($plugin
            ->getSupportedTargetLanguages($this, $this
            ->mapToRemoteLanguage($source_language)));
          if (empty($local_languages)) {
            return [];
          }
          $this->languageCache[$source_language] = $local_languages;
          $this
            ->updateCache();
        }
      }
      return $this->languageCache[$source_language];
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getSupportedLanguagePairs() {
    if ($plugin = $this
      ->getPlugin()) {
      $info = $plugin
        ->getPluginDefinition();
      if (isset($info['language_cache']) && empty($info['language_cache'])) {

        // This plugin doesn't support language caching.
        return $plugin
          ->getSupportedLanguagePairs($this);
      }
      else {

        // Retrieve the supported languages from the cache.
        if (empty($this->languagePairsCache) && ($cache = \Drupal::cache('data')
          ->get('tmgmt_language_pairs:' . $this->name))) {
          $this->languagePairsCache = $cache->data;
        }

        // Even if we successfully queried the cache data might not be yet
        // available.
        if (empty($this->languagePairsCache)) {
          $this->languagePairsCache = $plugin
            ->getSupportedLanguagePairs($this);
          $this
            ->updateCache();
        }
      }
      return $this->languagePairsCache;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getSupportedRemoteLanguages() {
    if ($plugin = $this
      ->getPlugin()) {
      if (empty($this->remoteLanguages) && ($cache = \Drupal::cache('data')
        ->get('tmgmt_remote_languages:' . $this->name))) {
        $this->remoteLanguages = $cache->data;
      }
      if (empty($this->remoteLanguages)) {
        $this->remoteLanguages = $plugin
          ->getSupportedRemoteLanguages($this);
        $info = $plugin
          ->getPluginDefinition();
        if (!isset($info['language_cache']) || !empty($info['language_cache'])) {
          \Drupal::cache('data')
            ->set('tmgmt_remote_languages:' . $this->name, $this->remoteLanguages, Cache::PERMANENT, $this
            ->getCacheTags());
        }
      }
    }
    return $this->remoteLanguages;
  }

  /**
   * {@inheritdoc}
   */
  public function clearLanguageCache() {
    $this->languageCache = array();
    \Drupal::cache('data')
      ->delete('tmgmt_languages:' . $this->name);
    \Drupal::cache('data')
      ->delete('tmgmt_language_pairs:' . $this->name);
    \Drupal::cache('data')
      ->delete('tmgmt_remote_languages:' . $this->name);
  }

  /**
   * {@inheritdoc}
   */
  public function checkTranslatable(JobInterface $job) {
    if ($plugin = $this
      ->getPlugin()) {
      return $plugin
        ->checkTranslatable($this, $job);
    }
    return TranslatableResult::no(t('Missing provider plugin'));
  }

  /**
   * {@inheritdoc}
   */
  public function checkAvailable() {
    if ($plugin = $this
      ->getPlugin()) {
      return $plugin
        ->checkAvailable($this);
    }
    return AvailableResult::no(t('@translator is not available. Make sure it is properly <a href=:configured>configured</a>.', [
      '@translator' => $this
        ->label(),
      ':configured' => $this
        ->toUrl()
        ->toString(),
    ]));
  }

  /**
   * {@inheritdoc}
   */
  public function hasCheckoutSettings(JobInterface $job) {
    if ($plugin = $this
      ->getPlugin()) {
      return $plugin
        ->hasCheckoutSettings($job);
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function getRemoteLanguagesMappings() {
    $remote_languages_mappings = [];
    foreach (\Drupal::languageManager()
      ->getLanguages() as $language => $info) {
      $remote_languages_mappings[$language] = $this
        ->mapToRemoteLanguage($language);
    }
    return $remote_languages_mappings;
  }

  /**
   * {@inheritdoc}
   */
  public function mapToLocalLanguages(array $remote_languages) {
    $local_languages = array();
    $remote_mappings = $this
      ->getPlugin()
      ->getDefaultRemoteLanguagesMappings();
    foreach ($remote_languages as $language => $info) {
      if (in_array($language, $remote_mappings)) {
        $local_language = array_search($language, $remote_mappings);
        $local_languages[$local_language] = $local_language;
      }
      else {
        $local_languages[$language] = $this
          ->mapToRemoteLanguage($language);
      }
    }
    foreach (\Drupal::languageManager()
      ->getLanguages() as $language => $info) {
      $remote_language = $this
        ->mapToRemoteLanguage($language);
      if (isset($remote_languages[$remote_language])) {
        $local_languages[$language] = $language;
      }
    }
    return $local_languages;
  }

  /**
   * {@inheritdoc}
   */
  public function mapToRemoteLanguage($language) {
    if (!$this
      ->providesRemoteLanguageMappings()) {
      return $language;
    }
    $mapping = $this
      ->get('remote_languages_mappings');
    $remote_languages = $this
      ->getSupportedRemoteLanguages();
    if (!empty($mapping) && array_key_exists($language, $mapping)) {
      if (empty($remote_languages) || array_key_exists($mapping[$language], $remote_languages)) {
        return $mapping[$language];
      }
    }
    $default_mappings = $this
      ->getPlugin()
      ->getDefaultRemoteLanguagesMappings();
    if (isset($default_mappings[$language])) {
      return $default_mappings[$language];
    }
    if ($matching_language = \Drupal::service('tmgmt.language_matcher')
      ->getMatchingLangcode($language, $remote_languages)) {
      return $matching_language;
    }
    return $language;
  }

  /**
   * Updates the language cache.
   */
  protected function updateCache() {
    if ($plugin = $this
      ->getPlugin()) {
      $info = $plugin
        ->getPluginDefinition();
      if (!isset($info['language_cache']) || !empty($info['language_cache'])) {
        \Drupal::cache('data')
          ->set('tmgmt_languages:' . $this->name, $this->languageCache, Cache::PERMANENT, $this
          ->getCacheTags());
        \Drupal::cache('data')
          ->set('tmgmt_language_pairs:' . $this->name, $this->languagePairsCache, Cache::PERMANENT, $this
          ->getCacheTags());
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function providesRemoteLanguageMappings() {
    $definition = \Drupal::service('plugin.manager.tmgmt.translator')
      ->getDefinition($this
      ->getPluginId());
    if (!isset($definition['map_remote_languages'])) {
      return TRUE;
    }
    return $definition['map_remote_languages'];
  }

  /**
   * {@inheritdoc}
   */
  public function hasCustomSettingsHandling() {
    $definition = \Drupal::service('plugin.manager.tmgmt.translator')
      ->getDefinition($this
      ->getPluginId());
    if (isset($definition['job_settings_custom_handling'])) {
      return $definition['job_settings_custom_handling'];
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    parent::calculateDependencies();
    if ($this
      ->getPlugin()) {
      $this
        ->addDependency('module', $this
        ->getPlugin()
        ->getPluginDefinition()['provider']);
    }
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$status protected property The enabled/disabled status of the configuration entity. 4
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityBase::createDuplicate 1
ConfigEntityBase::disable public function Disables the configuration entity. Overrides ConfigEntityInterface::disable 1
ConfigEntityBase::enable public function Enables the configuration entity. Overrides ConfigEntityInterface::enable
ConfigEntityBase::get public function Returns the value of a property. Overrides ConfigEntityInterface::get
ConfigEntityBase::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityBase::getCacheTagsToInvalidate 1
ConfigEntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityBase::getConfigDependencyName
ConfigEntityBase::getConfigManager protected static function Gets the configuration manager.
ConfigEntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityBase::getConfigTarget
ConfigEntityBase::getDependencies public function Gets the configuration dependencies. Overrides ConfigEntityInterface::getDependencies
ConfigEntityBase::getOriginalId public function Gets the original ID. Overrides EntityBase::getOriginalId
ConfigEntityBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
ConfigEntityBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
ConfigEntityBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
ConfigEntityBase::getTypedConfig protected function Gets the typed config manager.
ConfigEntityBase::hasTrustedData public function Gets whether on not the data is trusted. Overrides ConfigEntityInterface::hasTrustedData
ConfigEntityBase::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the config system already invalidates them. Overrides EntityBase::invalidateTagsOnDelete
ConfigEntityBase::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system already invalidates it. Overrides EntityBase::invalidateTagsOnSave
ConfigEntityBase::isInstallable public function Checks whether this entity is installable. Overrides ConfigEntityInterface::isInstallable 2
ConfigEntityBase::isNew public function Overrides Entity::isNew(). Overrides EntityBase::isNew
ConfigEntityBase::isUninstalling public function Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface::isUninstalling
ConfigEntityBase::link public function Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase::link
ConfigEntityBase::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface::onDependencyRemoval 7
ConfigEntityBase::preSave public function Acts on an entity before the presave hook is invoked. Overrides EntityBase::preSave 13
ConfigEntityBase::save public function Saves an entity permanently. Overrides EntityBase::save 1
ConfigEntityBase::set public function Sets the value of a property. Overrides ConfigEntityInterface::set
ConfigEntityBase::setOriginalId public function Sets the original ID. Overrides EntityBase::setOriginalId
ConfigEntityBase::setStatus public function Sets the status of the configuration entity. Overrides ConfigEntityInterface::setStatus
ConfigEntityBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
ConfigEntityBase::setUninstalling public function
ConfigEntityBase::sort public static function Helper callback for uasort() to sort configuration entities by weight and label. 6
ConfigEntityBase::status public function Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface::status 4
ConfigEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray 2
ConfigEntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityBase::toUrl
ConfigEntityBase::trustData public function Sets that the data should be trusted. Overrides ConfigEntityInterface::trustData
ConfigEntityBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
ConfigEntityBase::url public function Gets the public URL for this entity. Overrides EntityBase::url
ConfigEntityBase::urlInfo public function Gets the URL object for the entity. Overrides EntityBase::urlInfo
ConfigEntityBase::__construct public function Constructs an Entity object. Overrides EntityBase::__construct 10
ConfigEntityBase::__sleep public function Overrides EntityBase::__sleep 4
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 1
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency. Aliased as: addDependencyTrait
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function Checks data value access. Overrides AccessibleInterface::access 1
EntityBase::bundle public function Gets the bundle of the entity. Overrides EntityInterface::bundle 1
EntityBase::create public static function Constructs a new entity object, without permanently saving it. Overrides EntityInterface::create
EntityBase::delete public function Deletes an entity permanently. Overrides EntityInterface::delete 2
EntityBase::enforceIsNew public function Enforces an entity to be new. Overrides EntityInterface::enforceIsNew
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
EntityBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
EntityBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getEntityType public function Gets the entity type definition. Overrides EntityInterface::getEntityType
EntityBase::getEntityTypeId public function Gets the ID of the type of the entity. Overrides EntityInterface::getEntityTypeId
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getTypedData public function Gets a typed data object for this entity object. Overrides EntityInterface::getTypedData
EntityBase::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityInterface::hasLinkTemplate
EntityBase::label public function Gets the label of the entity. Overrides EntityInterface::label 6
EntityBase::language public function Gets the language of the entity. Overrides EntityInterface::language 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function Loads an entity. Overrides EntityInterface::load
EntityBase::loadMultiple public static function Loads one or more entities. Overrides EntityInterface::loadMultiple
EntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityInterface::postCreate 4
EntityBase::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface::postDelete 16
EntityBase::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
EntityBase::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityInterface::postSave 14
EntityBase::preCreate public static function Changes the values of an entity before it is created. Overrides EntityInterface::preCreate 5
EntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityInterface::referencedEntities 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::uriRelationships public function Gets a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityBase::urlRouteParameters protected function Gets an array of placeholders for this entity. 2
EntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler. 1
PluginDependencyTrait::themeHandler protected function Wraps the theme handler. 1
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
SynchronizableEntityTrait::$isSyncing protected property Whether this entity is being created, updated or deleted through a synchronization process.
SynchronizableEntityTrait::isSyncing public function
SynchronizableEntityTrait::setSyncing public function
Translator::$auto_accept protected property Whether to skip reviewing process and auto accepting translation.
Translator::$description protected property Description of the translator.
Translator::$label protected property Label of the translator.
Translator::$languageCache protected property The supported target languages caches.
Translator::$languageCacheOutdated protected property Whether the language cache in the database is outdated.
Translator::$languagePairsCache protected property The supported language pairs caches.
Translator::$name protected property Machine readable name of the translator.
Translator::$plugin protected property Plugin name of the translator.
Translator::$remoteLanguages protected property The supported remote languages caches.
Translator::$remote_languages_mappings protected property The remote languages mappings.
Translator::$settings protected property Translator type specific settings.
Translator::$uuid protected property The UUID of this translator. Overrides ConfigEntityBase::$uuid
Translator::$weight protected property Weight of the translator.
Translator::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase::calculateDependencies
Translator::checkAvailable public function Checks whether a translator is available. Overrides TranslatorInterface::checkAvailable
Translator::checkTranslatable public function Check whether this translator can handle a particular translation job. Overrides TranslatorInterface::checkTranslatable
Translator::clearLanguageCache public function Clears the language cache for this translator. Overrides TranslatorInterface::clearLanguageCache
Translator::getDescription public function Returns the translator plugin ID. Overrides TranslatorInterface::getDescription
Translator::getPlugin public function Returns the translator plugin of this translator. Overrides TranslatorInterface::getPlugin
Translator::getPluginId public function Returns the translator plugin ID. Overrides TranslatorInterface::getPluginId
Translator::getRemoteLanguagesMappings public function Gets existing remote languages mappings. Overrides TranslatorInterface::getRemoteLanguagesMappings
Translator::getSetting public function Retrieves a setting value from the translator settings. Overrides TranslatorInterface::getSetting
Translator::getSettings public function Returns the array of settings. Overrides TranslatorInterface::getSettings
Translator::getSupportedLanguagePairs public function Gets the supported language pairs for this translator. Overrides TranslatorInterface::getSupportedLanguagePairs
Translator::getSupportedRemoteLanguages public function Gets all supported languages of the translator plugin. Overrides TranslatorInterface::getSupportedRemoteLanguages
Translator::getSupportedTargetLanguages public function Returns the supported target languages for this translator. Overrides TranslatorInterface::getSupportedTargetLanguages
Translator::hasCheckoutSettings public function Returns if the plugin has any settings for this job. Overrides TranslatorInterface::hasCheckoutSettings
Translator::hasCustomSettingsHandling public function Determines if job settings of the translator will be handled by its plugin. Overrides TranslatorInterface::hasCustomSettingsHandling
Translator::hasPlugin public function Checks if the translator plugin of this translator exists. Overrides TranslatorInterface::hasPlugin
Translator::id public function Gets the identifier. Overrides EntityBase::id
Translator::isAutoAccept public function Checks if it can skip the reviewing process and automatically accepts all translations. Overrides TranslatorInterface::isAutoAccept
Translator::mapToLocalLanguages public function Maps remote languages to local languages. Overrides TranslatorInterface::mapToLocalLanguages
Translator::mapToRemoteLanguage public function Maps local language to remote language. Overrides TranslatorInterface::mapToRemoteLanguage
Translator::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides ConfigEntityBase::preDelete
Translator::providesRemoteLanguageMappings public function Determines if this translator supports remote language mappings. Overrides TranslatorInterface::providesRemoteLanguageMappings
Translator::setAutoAccept public function Sets whether to skip the reviewing process and automatically accept all translations. Overrides TranslatorInterface::setAutoAccept
Translator::setPluginID public function Sets the plugin ID. Overrides TranslatorInterface::setPluginID
Translator::setSetting public function Sets a definition setting. Overrides TranslatorInterface::setSetting
Translator::setSettings public function Sets the array of settings. Overrides TranslatorInterface::setSettings
Translator::updateCache protected function Updates the language cache.