src/Controller/FrontendPageController.php
protected function getTranslationRoute($referrer, $oldLocale, $locale)
    {
        /** @var $languageSwitcherHelper LanguageSwitcherHelper */
        $languageSwitcherHelper = $this->get('networking_init_cms.page.helper.language_switcher');

        $oldURL = $languageSwitcherHelper->getPathInfo($referrer);

        return $languageSwitcherHelper->getTranslationRoute($oldURL, $oldLocale, $locale);
    }
protected function getTranslationRoute($referrer, $oldLocale, $locale)
    {
        /** @var $languageSwitcherHelper LanguageSwitcherHelper */
        $languageSwitcherHelper = $this->get('networking_init_cms.page.helper.language_switcher');

        $oldURL = $languageSwitcherHelper->getPathInfo($referrer);

        return $languageSwitcherHelper->getTranslationRoute($oldURL, $oldLocale, $locale);
    }
protected function getTranslationRoute ( $ referrer , $ oldLocale , $ locale ) { /** @var $languageSwitcherHelper LanguageSwitcherHelper */ $ languageSwitcherHelper = $ this -> get ( 'networking_init_cms.page.helper.language_switcher' ) ; $ oldURL = $ languageSwitcherHelper -> getPathInfo ( $ referrer ) ; return $ languageSwitcherHelper -> getTranslationRoute ( $ oldURL , $ oldLocale , $ locale ) ; }
get the route for the translation of a given page, the referrer page.

@param $referrer
@param $oldLocale
@param $locale

@return array|RouteObjectInterface
get the route for the translation of a given page the referrer page .