protected function choosePrioritizedLanguageCode(array $entries, $showAllTranslations, array $prioritizedLanguageList)
    {
        foreach ($prioritizedLanguageList as $prioritizedLanguageCode) {
            if (isset($entries['translations'][$prioritizedLanguageCode])) {
                return $prioritizedLanguageCode;
            }
        }

        if ($entries['always-available'] || $showAllTranslations) {
            reset($entries['translations']);

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

        return false;
    }
protected function choosePrioritizedLanguageCode(array $entries, $showAllTranslations, array $prioritizedLanguageList)
    {
        foreach ($prioritizedLanguageList as $prioritizedLanguageCode) {
            if (isset($entries['translations'][$prioritizedLanguageCode])) {
                return $prioritizedLanguageCode;
            }
        }

        if ($entries['always-available'] || $showAllTranslations) {
            reset($entries['translations']);

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

        return false;
    }
protected function choosePrioritizedLanguageCode ( array $ entries , $ showAllTranslations , array $ prioritizedLanguageList ) { foreach ( $ prioritizedLanguageList as $ prioritizedLanguageCode ) { if ( isset ( $ entries [ 'translations' ] [ $ prioritizedLanguageCode ] ) ) { return $ prioritizedLanguageCode ; } } if ( $ entries [ 'always-available' ] || $ showAllTranslations ) { reset ( $ entries [ 'translations' ] ) ; return key ( $ entries [ 'translations' ] ) ; } return false ; }
Returns language code with highest priority.

Will return false if language code could not be matched with language settings in place.

@param array $entries
@param bool $showAllTranslations
@param string[] $prioritizedLanguageList

@return string|bool
Returns language code with highest priority .