You are here

public function LingotekConfigTranslationService::getConfigTargetStatus in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  2. 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  3. 3.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  4. 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  5. 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  6. 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  7. 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  8. 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  9. 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  10. 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
  11. 3.8.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()

Gets the translation status of a given entity translation for a locale.

Parameters

\Drupal\config_translation\ConfigNamesMapper $mapper: The entity which status we want to get.

string $locale: Lingotek translation language which we want to get.

Return value

int The status of the target translation (see Lingotek class constants)

Overrides LingotekConfigTranslationServiceInterface::getConfigTargetStatus

6 calls to LingotekConfigTranslationService::getConfigTargetStatus()
LingotekConfigTranslationService::addConfigTarget in src/LingotekConfigTranslationService.php
Request a translation for a given entity in the given locale.
LingotekConfigTranslationService::checkConfigTargetStatus in src/LingotekConfigTranslationService.php
Checks the status of the translation in the Lingotek service.
LingotekConfigTranslationService::checkConfigTargetStatuses in src/LingotekConfigTranslationService.php
Checks the status of the translations in the Lingotek service.
LingotekConfigTranslationService::markConfigTranslationsAsDirty in src/LingotekConfigTranslationService.php
Marks the translation status as dirty if they exist.
LingotekConfigTranslationService::requestConfigTranslations in src/LingotekConfigTranslationService.php
Request all translations for a given mapper in all locales.

... See full list

File

src/LingotekConfigTranslationService.php, line 971

Class

LingotekConfigTranslationService
Service for managing Lingotek configuration translations.

Namespace

Drupal\lingotek

Code

public function getConfigTargetStatus(ConfigNamesMapper $mapper, $langcode) {
  $status = Lingotek::STATUS_UNTRACKED;
  foreach ($mapper
    ->getConfigNames() as $config_name) {
    $metadata = LingotekConfigMetadata::loadByConfigName($config_name);
    $translation_status = $metadata
      ->getTargetStatus();
    if (count($translation_status) > 0 && isset($translation_status[$langcode])) {
      $status = $translation_status[$langcode];
    }
  }
  return $status;
}