concrete/src/Localization/Service/CountryList.php
public function getCountriesForLanguage($languageCode, $languageStatuses = 'orfm')
    {
        $territories = [];
        foreach (\Punic\Territory::getTerritoriesForLanguage($languageCode) as $territory) {
            $territoryLanguages = \Punic\Territory::getLanguages($territory, $languageStatuses, true);
            if (in_array($languageCode, $territoryLanguages)) {
                $territories[] = $territory;
            }
        }
        
        $validCountryCodes = array_keys($this->getCountries());
        $result = array_intersect($territories, $validCountryCodes);

        return array_values($result);
    }
public function getCountriesForLanguage($languageCode, $languageStatuses = 'orfm')
    {
        $territories = [];
        foreach (\Punic\Territory::getTerritoriesForLanguage($languageCode) as $territory) {
            $territoryLanguages = \Punic\Territory::getLanguages($territory, $languageStatuses, true);
            if (in_array($languageCode, $territoryLanguages)) {
                $territories[] = $territory;
            }
        }
        
        $validCountryCodes = array_keys($this->getCountries());
        $result = array_intersect($territories, $validCountryCodes);

        return array_values($result);
    }
public function getCountriesForLanguage ( $ languageCode , $ languageStatuses = 'orfm' ) { $ territories = [ ] ; foreach ( \ Punic \ Territory :: getTerritoriesForLanguage ( $ languageCode ) as $ territory ) { $ territoryLanguages = \ Punic \ Territory :: getLanguages ( $ territory , $ languageStatuses , true ) ; if ( in_array ( $ languageCode , $ territoryLanguages ) ) { $ territories [ ] = $ territory ; } } $ validCountryCodes = array_keys ( $ this -> getCountries ( ) ) ; $ result = array_intersect ( $ territories , $ validCountryCodes ) ; return array_values ( $ result ) ; }
Return a list of territory codes where a specific language is spoken, sorted by the total number of people speaking that language.

@param string $languageCode The language code (eg. 'en')
@param string $languageStatuses The allowed statuses of the languages, whose codes are 'o' (official), 'r' (official regional), 'f' (de facto official), 'm' (official minority), 'u' (unofficial or unknown)

@return array Returns a list of country codes
Return a list of territory codes where a specific language is spoken sorted by the total number of people speaking that language .