public function LingotekConfigTranslationService::getConfigTargetStatus in Lingotek Translation 3.0.x
Same name and namespace in other branches
- 8 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 8.2 src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 4.0.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.1.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.2.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.3.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.4.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.5.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.6.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 3.7.x src/LingotekConfigTranslationService.php \Drupal\lingotek\LingotekConfigTranslationService::getConfigTargetStatus()
- 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.
File
- src/
LingotekConfigTranslationService.php, line 964
Class
- LingotekConfigTranslationService
- Service for managing Lingotek configuration translations.
Namespace
Drupal\lingotekCode
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;
}