src/Cms/LocaleAwareTrait.php
protected function buildAlternateTranslations()
    {
        $translations = [];

        $context  = $this->contextObject();
        $origLang = $this->currentLanguage();

        $this->translator()->isIteratingLocales = true;
        foreach ($this->locales() as $langCode => $localeStruct) {
            if ($langCode === $origLang) {
                continue;
            }

            $this->translator()->setLocale($langCode);

            $translations[$langCode] = $this->formatAlternateTranslation($context, $localeStruct);
        }

        $this->translator()->setLocale($origLang);
        unset($this->translator()->isIteratingLocales);

        return $translations;
    }
protected function buildAlternateTranslations()
    {
        $translations = [];

        $context  = $this->contextObject();
        $origLang = $this->currentLanguage();

        $this->translator()->isIteratingLocales = true;
        foreach ($this->locales() as $langCode => $localeStruct) {
            if ($langCode === $origLang) {
                continue;
            }

            $this->translator()->setLocale($langCode);

            $translations[$langCode] = $this->formatAlternateTranslation($context, $localeStruct);
        }

        $this->translator()->setLocale($origLang);
        unset($this->translator()->isIteratingLocales);

        return $translations;
    }
protected function buildAlternateTranslations ( ) { $ translations = [ ] ; $ context = $ this -> contextObject ( ) ; $ origLang = $ this -> currentLanguage ( ) ; $ this -> translator ( ) -> isIteratingLocales = true ; foreach ( $ this -> locales ( ) as $ langCode => $ localeStruct ) { if ( $ langCode === $ origLang ) { continue ; } $ this -> translator ( ) -> setLocale ( $ langCode ) ; $ translations [ $ langCode ] = $ this -> formatAlternateTranslation ( $ context , $ localeStruct ) ; } $ this -> translator ( ) -> setLocale ( $ origLang ) ; unset ( $ this -> translator ( ) -> isIteratingLocales ) ; return $ translations ; }
Build the alternate translations associated with the current route.

This method _excludes_ the current route's canonical URI.

@return array
Build the alternate translations associated with the current route .