$storage = $this->container->get('entity_type.manager') ->getStorage($this->entityTypeId); $storage->resetCache([$this->entityId]); $entity = $storage->load($this->entityId); foreach($this->langcodes as$langcode){ if($entity->hasTranslation($langcode)){ $language = newLanguage(['id' => $langcode]); // Request the front page in this language and assert that the right
// translation shows up in the shortcut list with the right path.
$this->drupalGet('<front>', ['language' => $language]);
// Ensure that a block translation can be created using the same description
// as in the original language.
$default_langcode = $this->langcodes[0]; $values = $this->getNewEntityValues($default_langcode); $storage = \Drupal::entityTypeManager()->getStorage($this->entityTypeId); /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ $entity = $storage->create(['type' => 'basic'] + $values); $entity->save(); $entity->addTranslation('it', $values);