I have code running from a hook_node_update which renders the full content so that I can parse the result.
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
// Drupal fails to handle language correctly here.. need to fake it out.. ughh!!
$pre_render = $view_builder->view($node, 'full', $langcode);
$html = \Drupal::service('renderer')->render($pre_render);
$dom = Html::load($html);
this has been working fine when I edit the EN version of the page or when I edit the FR version of the page. I have now realized that I need to do both EN and FR when either is updated.
I figured looping through en/fr would do this, but no matter what I try; I seem to be only able to render in the current language.
I have even tried using $node->getTranslation('fr') when updating the EN page, but no luck.
What am I missing here? viewBuilder() seems to be language aware; yet it isn't.
EDIT
Apparently my issue stems from having Paragraphs on the page. It seems that there is no recursive method to render nodes with referenced entities like Paragraphs.
Solution seems to be that it is necessary to go though all the paragraph files on the node and create render arrays for each one (in the correct language) and then attach them to an overall render array. For my particular use case where content order of the rendered output will not matter; this is unfortunate but possible.