private function hidePagesIfNotTranslated($pages)
    {
        $language = GeneralUtility::_GET('L');
        if ($this->isPageNotTranslated($language)) {
            foreach ($pages as $key => $page) {
                $pageOverlay = $this->pageRepository->getPageOverlay($page, $language);
                if (empty($pageOverlay['_PAGES_OVERLAY'])) {
                    unset($pages[$key]);
                }
            }
        }

        return $pages;
    }