private function filterLocales(array $locales)
    {
        $z = self::DEFAULT_SORT_PRIORITY;

        $filteredLocales = [];
        foreach ($locales as $langCode => $locale) {
            if (isset($locale['active']) && !$locale['active']) {
                continue;
            }

            if (!isset($locale['priority'])) {
                $locale['priority'] = $z++;
            }

            if (!isset($locale['locale'])) {
                $locale['locale'] = $langCode;
            }

            $filteredLocales[$langCode] = $locale;
        }

        return $filteredLocales;
    }
private function filterLocales(array $locales)
    {
        $z = self::DEFAULT_SORT_PRIORITY;

        $filteredLocales = [];
        foreach ($locales as $langCode => $locale) {
            if (isset($locale['active']) && !$locale['active']) {
                continue;
            }

            if (!isset($locale['priority'])) {
                $locale['priority'] = $z++;
            }

            if (!isset($locale['locale'])) {
                $locale['locale'] = $langCode;
            }

            $filteredLocales[$langCode] = $locale;
        }

        return $filteredLocales;
    }
private function filterLocales ( array $ locales ) { $ z = self :: DEFAULT_SORT_PRIORITY ; $ filteredLocales = [ ] ; foreach ( $ locales as $ langCode => $ locale ) { if ( isset ( $ locale [ 'active' ] ) && ! $ locale [ 'active' ] ) { continue ; } if ( ! isset ( $ locale [ 'priority' ] ) ) { $ locale [ 'priority' ] = $ z ++ ; } if ( ! isset ( $ locale [ 'locale' ] ) ) { $ locale [ 'locale' ] = $ langCode ; } $ filteredLocales [ $ langCode ] = $ locale ; } return $ filteredLocales ; }
Filter the available languages.

Routine:
1. Removes disabled languages
2. Assigns a priority, if absent
3. Assigns a locale, if absent

@param  array $locales The locales configuration structure.
@return array The parsed language structures.
Filter the available languages .