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;
    }