ConfigurableLanguageRenderer example

        $class = '\Drupal\views\Entity\Render\\' . $dynamic_renderers[$rendering_language];
        $this->entityTranslationRenderer = new $class($view$this->getLanguageManager()$entity_type);
      }
      else {
        if (str_contains($rendering_language, '***LANGUAGE_')) {
          $langcode = PluginBase::queryLanguageSubstitutions()[$rendering_language];
        }
        else {
          // Specific langcode set.           $langcode = $rendering_language;
        }
        $this->entityTranslationRenderer = new ConfigurableLanguageRenderer($view$this->getLanguageManager()$entity_type$langcode);
      }
    }
    return $this->entityTranslationRenderer;
  }

  /** * Returns the entity translation matching the configured row language. * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity object the field value being processed is attached to. * @param \Drupal\views\ResultRow $row * The result row the field value being processed belongs to. * * @return \Drupal\Core\Entity\FieldableEntityInterface * The entity translation object for the specified row. * * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use * \Drupal\views\Entity\Render\EntityTranslationRenderTrait::getEntityTranslationByRelationship * instead. * * @see https://www.drupal.org/node/3311862 */
Home | Imprint | This part of the site doesn't use cookies.