public EntityRepository::getTranslationFromContext(EntityInterface $entity, $langcode = NULL, $context = array())
Gets the entity translation to be used in the given context.
This will check whether a translation for the desired language is available and if not, it will fall back to the most appropriate translation based on the provided context.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity whose translation will be returned.
string $langcode: (optional) The language of th