Loading translations of inline relations

Hi! After so many years of typo3 development i am still a little confused about how translated inline relations should be loaded correctly. Is it correct to load all records pointing to the “_LOCALIZED_UID” of the parent or is it correct to load all records pointing to the “uid” of the parent and applying overlays using the “PageRepository” class.

I am sorry if this very generic question has been asked before but i could not find a definitive answer.

In my case i load inline relations via a DataProcessing implementation. The translated content is not rendered as expected by the customer and i want to fix the relation-loading “correctly”. My options are either use _LOCALIZED_UID or doing the overlay thing.

Update

What i ended up doing at the moment is:

  1. When adding the constraints to the database query, i use the _LOCALIZED_UID when available and the uid when not ($data[‘_LOCALIZED_UID’] ?? $data[‘uid’])
  2. After loading the record, a run PageRepository::getRecordOverlay($recordType, $row)

Is this the “correct” approach when loading custom inline relations?