<?php

namespace Concrete\Core\Localization\Service;
use Punic\Language;
use Punic\Territory;
use Localization;

defined('C5_EXECUTE') or die("Access Denied.");

class LanguageList
{
    /**
     * Returns an associative array with the locale code as the key and the translated language name as the value.
     * @return array
     */
    public function getLanguageList()
    {
        $languages = Language::getAll(false, false, Localization::activeLocale());
        return $languages;
    }

}

<?php

namespace Concrete\Core\Localization\Service;
use Punic\Language;
use Punic\Territory;
use Localization;

defined('C5_EXECUTE') or die("Access Denied.");

class LanguageList
{
    /**
     * Returns an associative array with the locale code as the key and the translated language name as the value.
     * @return array
     */
    public function getLanguageList()
    {
        $languages = Language::getAll(true, true);
        return $languages;
    }

}

Remove country and script specifications from languages
Remove country and script specifications from languages

A language is only 'en', a locale is 'en_US': remove country codes from
getLanguageList so that we have only languages and not locales.

Furthermore we don't need to tell Punic which is the active locale:
Localization::changeLocale already sets the Punic default locale.
