protected function ContentTranslationUITestBase::getTranslation in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase::getTranslation()
- 9 core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase::getTranslation()
Returns the translation object to use to retrieve the translated values.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity being tested.
string $langcode: The language code identifying the translation to be retrieved.
Return value
\Drupal\Core\TypedData\TranslatableInterface The translation object to act on.
File
- core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationUITestBase.php, line 476
Class
- ContentTranslationUITestBase
- Tests the Content Translation UI.
Namespace
Drupal\Tests\content_translation\FunctionalCode
protected function getTranslation(EntityInterface $entity, $langcode) {
return $entity
->getTranslation($langcode);
}