public function getPrimaryLanguage(array $priorityLanguages = array())
    {
        $votedLanguages = $this->getVoteLanguages(self::VOTED_HIGH);

        if (!count($votedLanguages)) {
            $votedLanguages = $this->getVoteLanguages();

            if (!count($votedLanguages)) {
                return null;
            }
        }

        if (!count($priorityLanguages)) {
            return array_shift($votedLanguages);
        }

        if (count($priorityLanguages) == 1) {
            return $priorityLanguages[0];
        }

        foreach ($priorityLanguages as $priorityLanguage) {
            if (in_array($priorityLanguage, $votedLanguages)) {
                return $priorityLanguage;
            }
        }

        return array_shift($priorityLanguages);
    }