Support requests in Drupal Core are not well attended. Did you figure this out?
- Status changed to Closed: outdated
5 months ago 6:42pm 28 July 2024
I'm rendering a node programmatically using this code:
$view_builder = \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId());
$language = $entity->language()->getId();
$build = $view_builder->view($entity, 'full', $language);
$body = \Drupal::service('renderer')->renderPlain($build)
When the node has views or blocks embedded in it, the translations are not picked up and the text in my $body is always the one coming from the default language.
When viewing the node everything is fine, but i'd expect the same thing to happen when i render the node programmatically...
Put my code for example in a hook node save and set a node type to be displayed with layout builder putting a translated block in it.
Closed: outdated
11.0 🔥
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Support requests in Drupal Core are not well attended. Did you figure this out?