protected function selectAliasLanguageCode(
        SPIURLAlias $spiUrlAlias,
        ?string $languageCode,
        bool $showAllTranslations,
        array $prioritizedLanguageList
    ) {
        if (isset($languageCode) && !in_array($languageCode, $spiUrlAlias->languageCodes)) {
            return false;
        }

        foreach ($prioritizedLanguageList as $prioritizedLanguageCode) {
            if (in_array($prioritizedLanguageCode, $spiUrlAlias->languageCodes)) {
                return $prioritizedLanguageCode;
            }
        }

        if ($spiUrlAlias->alwaysAvailable || $showAllTranslations) {
            $lastLevelData = end($spiUrlAlias->pathData);
            reset($lastLevelData['translations']);

            return key($lastLevelData['translations']);
        }

        return false;
    }
protected function selectAliasLanguageCode(
        SPIURLAlias $spiUrlAlias,
        ?string $languageCode,
        bool $showAllTranslations,
        array $prioritizedLanguageList
    ) {
        if (isset($languageCode) && !in_array($languageCode, $spiUrlAlias->languageCodes)) {
            return false;
        }

        foreach ($prioritizedLanguageList as $prioritizedLanguageCode) {
            if (in_array($prioritizedLanguageCode, $spiUrlAlias->languageCodes)) {
                return $prioritizedLanguageCode;
            }
        }

        if ($spiUrlAlias->alwaysAvailable || $showAllTranslations) {
            $lastLevelData = end($spiUrlAlias->pathData);
            reset($lastLevelData['translations']);

            return key($lastLevelData['translations']);
        }

        return false;
    }
protected function selectAliasLanguageCode ( SPIURLAlias $ spiUrlAlias , ? string $ languageCode , bool $ showAllTranslations , array $ prioritizedLanguageList ) { if ( isset ( $ languageCode ) && ! in_array ( $ languageCode , $ spiUrlAlias -> languageCodes ) ) { return false ; } foreach ( $ prioritizedLanguageList as $ prioritizedLanguageCode ) { if ( in_array ( $ prioritizedLanguageCode , $ spiUrlAlias -> languageCodes ) ) { return $ prioritizedLanguageCode ; } } if ( $ spiUrlAlias -> alwaysAvailable || $ showAllTranslations ) { $ lastLevelData = end ( $ spiUrlAlias -> pathData ) ; reset ( $ lastLevelData [ 'translations' ] ) ; return key ( $ lastLevelData [ 'translations' ] ) ; } return false ; }
Determines alias language code.

Method will return false if language code can't be matched against alias language codes or language settings.

@param \eZ\Publish\SPI\Persistence\Content\URLAlias $spiUrlAlias
@param string|null $languageCode
@param bool $showAllTranslations
@param string[] $prioritizedLanguageList

@return string|bool
Determines alias language code .