public function LingotekFake::getDocumentTranslationStatuses in Lingotek Translation 3.4.x
Same name and namespace in other branches
- 8 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 8.2 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 4.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.3.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.5.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.7.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
- 3.8.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getDocumentTranslationStatuses()
Gets the status of the translations.
Parameters
string $doc_id: The document ID in Lingotek.
Return value
array Returns array keyed by the locale with the percentage of completion.
Overrides LingotekInterface::getDocumentTranslationStatuses
File
- tests/
modules/ lingotek_test/ src/ LingotekFake.php, line 412
Class
Namespace
Drupal\lingotek_testCode
public function getDocumentTranslationStatuses($doc_id) {
if (!$doc_id) {
throw new LingotekApiException('Error requesting statuses without document id.');
}
if (\Drupal::state()
->get('lingotek.must_error_in_check_target_status', FALSE)) {
throw new LingotekApiException('Error was forced.');
}
$statuses = \Drupal::state()
->get('lingotek.document_completion_statuses', []);
if (!empty($statuses)) {
return $statuses;
}
if (\Drupal::state()
->get('lingotek.document_completion', TRUE)) {
return [
'es-MX' => 100,
'es-ES' => 100,
'de-AT' => 100,
'de-DE' => 100,
];
}
return [
'es-MX' => 80,
'es-ES' => 80,
'de-AT' => 80,
'de-DE' => 80,
];
}