You are here

public function LingotekFake::addTarget in Lingotek Translation 8

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

Requests a translation to the Lingotek service.

Parameters

string $doc_id: The document id to translate.

string $locale: The Lingotek locale to request.

\Drupal\lingotek\LingotekProfileInterface $profile: The profile being used.

Return value

mixed

Overrides LingotekInterface::addTarget

File

tests/modules/lingotek_test/src/LingotekFake.php, line 209

Class

LingotekFake

Namespace

Drupal\lingotek_test

Code

public function addTarget($doc_id, $locale, LingotekProfileInterface $profile = NULL) {
  \Drupal::state()
    ->set('lingotek.added_target_locale', $locale);
  \Drupal::state()
    ->set('lingotek.used_profile', $profile ? $profile
    ->id() : NULL);

  // Added locale as target.
  return TRUE;
}