private function sortTranslationsByPrioritizedLanguages(array $translations)
    {
        $sortedTranslations = array();
        foreach ($this->settings['prioritizedLanguageList'] as $languageCode) {
            if (isset($translations[$languageCode])) {
                $sortedTranslations[] = array(
                    'lang' => $languageCode,
                    'text' => $translations[$languageCode],
                );
                unset($translations[$languageCode]);
            }
        }

        foreach ($translations as $languageCode => $translation) {
            $sortedTranslations[] = array(
                'lang' => $languageCode,
                'text' => $translation,
            );
        }

        return $sortedTranslations;
    }
private function sortTranslationsByPrioritizedLanguages(array $translations)
    {
        $sortedTranslations = array();
        foreach ($this->settings['prioritizedLanguageList'] as $languageCode) {
            if (isset($translations[$languageCode])) {
                $sortedTranslations[] = array(
                    'lang' => $languageCode,
                    'text' => $translations[$languageCode],
                );
                unset($translations[$languageCode]);
            }
        }

        foreach ($translations as $languageCode => $translation) {
            $sortedTranslations[] = array(
                'lang' => $languageCode,
                'text' => $translation,
            );
        }

        return $sortedTranslations;
    }
private function sortTranslationsByPrioritizedLanguages ( array $ translations ) { $ sortedTranslations = array ( ) ; foreach ( $ this -> settings [ 'prioritizedLanguageList' ] as $ languageCode ) { if ( isset ( $ translations [ $ languageCode ] ) ) { $ sortedTranslations [ ] = array ( 'lang' => $ languageCode , 'text' => $ translations [ $ languageCode ] , ) ; unset ( $ translations [ $ languageCode ] ) ; } } foreach ( $ translations as $ languageCode => $ translation ) { $ sortedTranslations [ ] = array ( 'lang' => $ languageCode , 'text' => $ translation , ) ; } return $ sortedTranslations ; }
Needed when translations for the part of the alias are the same for multiple languages.
In that case we need to ensure that more prioritized language is chosen.

@param array $translations

@return array
Needed when translations for the part of the alias are the same for multiple languages . In that case we need to ensure that more prioritized language is chosen .