/** * Create node translation seo metadata. * * @param NodeTranslationInterface $translation * * @return SeoMetadataInterface */ public function create(NodeTranslationInterface $translation) { $seoMetadata = $this->seoMetadataManager->create(); $seoMetadata->setLang($translation->getLang()); $seoMetadata->setTitle($translation->getTitle()); $this->seoMetadataManager->add($seoMetadata); return $seoMetadata; }
/** * Create node translation route. * * @param NodeTranslationInterface $translation * * @return RouteInterface */ public function create(NodeTranslationInterface $translation) { $locale = $translation->getLang(); $node = $translation->getNode(); $route = $this->routeManager->create(); $route->setRoutePattern($this->routerHelper->getRoutePattern($translation->getTitle(), $node, $locale)); $this->routeGenerator->generateRoute($route, $node, $locale); $this->routeManager->add($route); return $route; }