diff --git a/core/modules/taxonomy/src/TermBreadcrumbBuilder.php b/core/modules/taxonomy/src/TermBreadcrumbBuilder.php index 307170a..8240b8f 100644 --- a/core/modules/taxonomy/src/TermBreadcrumbBuilder.php +++ b/core/modules/taxonomy/src/TermBreadcrumbBuilder.php @@ -8,6 +8,7 @@ namespace Drupal\taxonomy; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; +use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Link; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; @@ -35,8 +36,10 @@ public function build(RouteMatchInterface $route_match) { // hard-coded presumption. Make this behavior configurable per // vocabulary or term. $breadcrumb = array(); - while ($parents = taxonomy_term_load_parents($term->id())) { + $language = \Drupal::service('language_manager')->getCurrentLanguage(LanguageInterface::TYPE_CONTENT); + while ($parents = \Drupal::entityManager()->getStorage('taxonomy_term')->loadParents($term->id())) { $term = array_shift($parents); + $term = $term->getTranslation($language->getId()); $breadcrumb[] = Link::createFromRoute($term->getName(), 'entity.taxonomy_term.canonical', array('taxonomy_term' => $term->id())); } $breadcrumb[] = Link::createFromRoute($this->t('Home'), '');