protected function getLanguages(array $siteList, $groupName)
    {
        $result = [];
        $allSame = true;
        $previousSA = null;
        foreach ($siteList as $siteaccess) {
            $result[$siteaccess] = $this->getParameter(
                'RegionalSettings', 'SiteLanguageList', 'site.ini', $siteaccess
            );
            if ($allSame && $previousSA !== null) {
                $allSame = ($result[$previousSA] === $result[$siteaccess]);
            }
            $previousSA = $siteaccess;
        }
        if ($allSame) {
            return [$groupName => $result[$previousSA]];
        }

        return $result;
    }
protected function getLanguages(array $siteList, $groupName)
    {
        $result = [];
        $allSame = true;
        $previousSA = null;
        foreach ($siteList as $siteaccess) {
            $result[$siteaccess] = $this->getParameter(
                'RegionalSettings', 'SiteLanguageList', 'site.ini', $siteaccess
            );
            if ($allSame && $previousSA !== null) {
                $allSame = ($result[$previousSA] === $result[$siteaccess]);
            }
            $previousSA = $siteaccess;
        }
        if ($allSame) {
            return [$groupName => $result[$previousSA]];
        }

        return $result;
    }
protected function getLanguages ( array $ siteList , $ groupName ) { $ result = [ ] ; $ allSame = true ; $ previousSA = null ; foreach ( $ siteList as $ siteaccess ) { $ result [ $ siteaccess ] = $ this -> getParameter ( 'RegionalSettings' , 'SiteLanguageList' , 'site.ini' , $ siteaccess ) ; if ( $ allSame && $ previousSA !== null ) { $ allSame = ( $ result [ $ previousSA ] === $ result [ $ siteaccess ] ) ; } $ previousSA = $ siteaccess ; } if ( $ allSame ) { return [ $ groupName => $ result [ $ previousSA ] ] ; } return $ result ; }
Returns the languages list for all siteaccess unless it's the same for
each one, in this case, it returns the languages list for the group.

@param array $siteList
@param string $groupName

@return array
Returns the languages list for all siteaccess unless it s the same for each one in this case it returns the languages list for the group .