Returns the language list based on a locale.

@param  string $locale
@return Collection
766449
public static function languages(string $locale = 'en') : Collection
    {
        return Collection::make(include __DIR__ . "/../../../umpirsky/language-list/data/{$locale}/language.php")->map(function ($lang) {
            return ucfirst($lang);
        });
    }
650461
public function locale($locale = null)
    {
        if ($locale) {
            $this->_locale = $locale;
        }
        if ($this->_locale) {
            return $this->_locale;
        }
        if (isset($this->_params['locale'])) {
            return $this->_params['locale'];
        }
    }
6768
public function all($locale = null){

        if(!$locale){
            $locale = $this->getLocale();
        }

        $this->load($locale);

        $translations = collect([]);
        foreach($this->languages[$locale] as $key => $arg){
            $translations->put($key, $arg['value']);
        }

        return $translations;
    }
1134584
public function getAll($locale)
    {
        $qb = $this->createQueryBuilder('r');

        $qb->addSelect('t');
        $qb->innerJoin('r.translations', 't');
        $qb->andWhere('t.locale=:locale');
        $qb->setParameter(':locale', $locale);

        return $qb->getQuery()->execute();
    }
599532
public static function getDisplayLocales($locale)
    {
        if (!isset(self::$locales[$locale])) {
            self::$locales[$locale] = Intl::getLocaleBundle()->getLocaleNames($locale);
        }

        return self::$locales[$locale];
    }
978176
public function find($locale)
    {
        if (null === static::$language) {
            foreach ($this->fetchAll() as $item) {
                if ($item->locale() == $locale || $item->iso6391() == $locale) {
                    static::$language = $item;
                    break;
                }
            }
        }

        return static::$language;
    }
1232357
private function getLocaleCode($locale)
    {
        $locales = explode('_', strtolower($locale));
        $locale = array_pop($locales);

        if ('en' === $locale) {
            $locale = 'gb';
        }

        return $locale;
    }
826476
protected function getLocale($locale)
    {
        $result = null;
        if ($locale instanceof LocaleEntity) {
            $result = $locale;
        } elseif (is_string($locale) && $locale !== '') {
            $result = $this->app->make(LocaleRepository::class)->findApproved($locale);
        }

        return $result;
    }
53234
public function findUsagesByLocales( $locale = null )
    {
        if ( empty( $locale ) )
        {
            $locale = $this->getLocale();
        }

        return $this->getMapper()
                    ->findUsagesByLocales( (array) $locale );
    }
546263
public function findAll($locale)
    {
        $units = $this->unitRepository->findAllByLocale($locale);

        array_walk(
            $units,
            function (&$unit) use ($locale) {
                $unit = new Unit($unit, $locale);
            }
        );

        return $units;
    }
987961
private function getCatalogue($locale)
    {
        if (empty($this->catalogues[$locale])) {
            $this->loadCatalogue($locale, $this->dir);
        }

        return $this->catalogues[$locale];
    }
940480
public function getLangByLocale($locale)
    {
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());

        // Sending service start event
        $arrayParameters = $this->sendEvent('melisengine_service_get_lang_by_local_start', $arrayParameters);

        // Service implementation start
        $langTable = $this->getServiceLocator()->get('MelisEngineTableCmsLang');
        $result = $langTable->getEntryByField('lang_cms_locale', $locale)->toArray();
        if(!isset($result[0]['lang_cms_locale'])) return null;
        $result = $result[0];
        // Service implementation end

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $result;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melisengine_service_get_lang_by_local_end', $arrayParameters);

        return $arrayParameters['results'];
    }
1080078
public function getPluralForms(Locale $locale)
    {
        if (!isset($this->rulesetsIndices[$locale->getLanguage()])) {
            return [self::RULE_OTHER];
        }

        $ruleset = $this->rulesets[$locale->getLanguage()][$this->rulesetsIndices[$locale->getLanguage()]] ?? null;

        if ($ruleset === null) {
            return [self::RULE_OTHER];
        }

        return array_merge(array_keys($ruleset), [self::RULE_OTHER]);
    }
2168
public function lookUpLanguageIdForLocale($locale)
    {
        $locale = $this->normalizeLocale($locale);

        /** @var Model $languageModel */
        $languageModel = static::$cmsLanguageModel;

        $language = $languageModel::where(config('pxlcms.translatable.locale_code_column'), $locale)
            ->remember((config('pxlcms.cache.languages', 15)))
            ->first();

        if (empty($language)) return null;

        return $language->id;
    }
1291193
protected function parseLocale($locale) {
        if (null == $locale) {
            return [$this->locale, $this->fallback];
        }

        return [$locale, $this->fallback];
    }
182272
public function getLocaleChain(Locale $locale)
    {
        $fallbackRule = $this->configuration->getFallbackRule();
        $localeChain = [(string)$locale => $locale];

        if ($fallbackRule['strict'] === true) {
            foreach ($fallbackRule['order'] as $localeIdentifier) {
                $localeChain[$localeIdentifier] = new Locale($localeIdentifier);
            }
        } else {
            $locale = $this->findBestMatchingLocale($locale);
            while ($locale !== null) {
                $localeChain[(string)$locale] = $locale;
                $locale = $this->getParentLocaleOf($locale);
            }
            foreach ($fallbackRule['order'] as $localeIdentifier) {
                $locale = new Locale($localeIdentifier);
                $locale = $this->findBestMatchingLocale($locale);
                while ($locale !== null) {
                    $localeChain[(string)$locale] = $locale;
                    $locale = $this->getParentLocaleOf($locale);
                }
            }
        }
        $locale = $this->configuration->getDefaultLocale();
        $localeChain[(string)$locale] = $locale;

        return $localeChain;
    }
778683
public function GetCulture( $locale )
	{
		if ( is_null( $locale ) || empty( $locale ) || $locale == XmlReservedNs::CollationCodepoint )
		{
			return null;
		}

		try
		{
			return Collator::create( $locale );
		}
		catch ( \Exception $ex )
		{
			throw new XPath2Exception( "XQST0076", Resources::XQST0076, $locale );
		}
	}