public function getRecord($id)
{
$record = parent::getRecord($id);
if (!$this->isDefaultLanguage()) {
if (TYPO3_MODE === 'FE') {
$pageRepository = $GLOBALS['TSFE']->sys_page;
} else {
$pageRepository = GeneralUtility::makeInstance(PageRepository::class);
$pageRepository->init(false);
}
/** @var PageRepository $pageRepository */
$localisation = $pageRepository->getPageOverlay($record, $this->getCurrentLanguageUid());
if (is_array($localisation)) {
$record = $localisation;
}
}
return $record;
}