src/Cms/LocaleAwareTrait.php
protected function formatAlternateTranslationUrl($context, array $localeStruct)
    {
        $isRoutable = ($context instanceof RoutableInterface && $context->isActiveRoute());
        $langCode   = $localeStruct['code'];
        $path       = ($isRoutable ? $context->url($langCode) : ($this->currentUrl() ? : $langCode));

        if ($path instanceof UriInterface) {
            $path = $path->getPath();
        }

        return $this->baseUrl()->withPath($path);
    }
protected function formatAlternateTranslationUrl($context, array $localeStruct)
    {
        $isRoutable = ($context instanceof RoutableInterface && $context->isActiveRoute());
        $langCode   = $localeStruct['code'];
        $path       = ($isRoutable ? $context->url($langCode) : ($this->currentUrl() ? : $langCode));

        if ($path instanceof UriInterface) {
            $path = $path->getPath();
        }

        return $this->baseUrl()->withPath($path);
    }
protected function formatAlternateTranslationUrl ( $ context , array $ localeStruct ) { $ isRoutable = ( $ context instanceof RoutableInterface && $ context -> isActiveRoute ( ) ) ; $ langCode = $ localeStruct [ 'code' ] ; $ path = ( $ isRoutable ? $ context -> url ( $ langCode ) : ( $ this -> currentUrl ( ) ? : $ langCode ) ) ; if ( $ path instanceof UriInterface ) { $ path = $ path -> getPath ( ) ; } return $ this -> baseUrl ( ) -> withPath ( $ path ) ; }
Format an alternate translation URL for the given translatable model.

Note: The application's locale is already modified and will be reset
after processing all available languages.

@param  mixed $context      The translated {@see \Charcoal\Model\ModelInterface model}
or array-accessible structure.
@param  array $localeStruct The currently iterated language.
@return string Returns a link.
Format an alternate translation URL for the given translatable model .