Returns a list of all localizations and sublocalizations.

@return Localization[]
512671
public function getAllLocalizations()
    {
        $localizations = [];
        if (null !== $this->getChildren() && count($this->getChildren()) > 0) {
            foreach ($this->getChildren() as $child) {
                $localizations[] = $child;
                $localizations = array_merge($localizations, $child->getAllLocalizations());
            }
        }

        return $localizations;
    }
1338537
public function list_languages()
    {
        static $sa_languages = array();

        if (!count($sa_languages)) {
            @include(RCUBE_LOCALIZATION_DIR . 'index.inc');

            if ($dh = @opendir(RCUBE_LOCALIZATION_DIR)) {
                while (($name = readdir($dh)) !== false) {
                    if ($name[0] == '.' || !is_dir(RCUBE_LOCALIZATION_DIR . $name)) {
                        continue;
                    }

                    if ($label = $rcube_languages[$name]) {
                        $sa_languages[$name] = $label;
                    }
                }
                closedir($dh);
            }
        }

        return $sa_languages;
    }
226091
public function getAvailableLangs(): array
    {
        $langs = ['en'];
        $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true);
        foreach ($scan as $row) {
            $langs[] = trim($row, '/');
        }
        return $langs;
    }
121506
public static function activeLocales(): array
    {
        $locales = app(ModuleService::class)
            ->findByInterface(ModuleLanguageInterface::class, false, true)
            ->map(static function (ModuleLanguageInterface $module): LocaleInterface {
                return $module->locale();
            });

        if ($locales->isEmpty()) {
            return [new LocaleEnUs()];
        }

        return $locales->all();
    }
1350116
public function getStructures()
    {
        $structures = [];
        foreach ($this->nodeHelper->getLanguagesForNode($this->node) as $locale) {
            $structures[] = $this->getStructure($locale);
        }

        return $structures;
    }
1056277
public function availableLocales()
    {
        $locales = $this->getCore()->config('locale.translation-locales');

        if (is_array($locales)) {
            return $locales;
        }

        return $this->getLocaleRepository()->getAvailable();
    }
559131
public function getLocaleOptions()
    {
        $localeOptions = [
            'ar'    => [Lang::get('system::lang.locale.ar'),    'flag-sa'],
            'be'    => [Lang::get('system::lang.locale.be'),    'flag-by'],
            'bg'    => [Lang::get('system::lang.locale.bg'),    'flag-bg'],
            'ca'    => [Lang::get('system::lang.locale.ca'),    'flag-es-ct'],
            'cs'    => [Lang::get('system::lang.locale.cs'),    'flag-cz'],
            'da'    => [Lang::get('system::lang.locale.da'),    'flag-dk'],
            'de'    => [Lang::get('system::lang.locale.de'),    'flag-de'],
            'el'    => [Lang::get('system::lang.locale.el'),    'flag-gr'],
            'en'    => [Lang::get('system::lang.locale.en'),    'flag-us'],
            'en-au' => [Lang::get('system::lang.locale.en-au'), 'flag-au'],
            'en-ca' => [Lang::get('system::lang.locale.en-ca'), 'flag-ca'],
            'en-gb' => [Lang::get('system::lang.locale.en-gb'), 'flag-gb'],
            'es'    => [Lang::get('system::lang.locale.es'),    'flag-es'],
            'es-ar' => [Lang::get('system::lang.locale.es-ar'), 'flag-ar'],
            'et'    => [Lang::get('system::lang.locale.et'),    'flag-ee'],
            'fa'    => [Lang::get('system::lang.locale.fa'),    'flag-ir'],
            'fi'    => [Lang::get('system::lang.locale.fi'),    'flag-fi'],
            'fr'    => [Lang::get('system::lang.locale.fr'),    'flag-fr'],
            'fr-ca' => [Lang::get('system::lang.locale.fr-ca'), 'flag-ca'],
            'hu'    => [Lang::get('system::lang.locale.hu'),    'flag-hu'],
            'id'    => [Lang::get('system::lang.locale.id'),    'flag-id'],
            'it'    => [Lang::get('system::lang.locale.it'),    'flag-it'],
            'ja'    => [Lang::get('system::lang.locale.ja'),    'flag-jp'],
            'kr'    => [Lang::get('system::lang.locale.kr'),    'flag-kr'],
            'lt'    => [Lang::get('system::lang.locale.lt'),    'flag-lt'],
            'lv'    => [Lang::get('system::lang.locale.lv'),    'flag-lv'],
            'nb-no' => [Lang::get('system::lang.locale.nb-no'), 'flag-no'],
            'nl'    => [Lang::get('system::lang.locale.nl'),    'flag-nl'],
            'pl'    => [Lang::get('system::lang.locale.pl'),    'flag-pl'],
            'pt-br' => [Lang::get('system::lang.locale.pt-br'), 'flag-br'],
            'pt-pt' => [Lang::get('system::lang.locale.pt-pt'), 'flag-pt'],
            'ro'    => [Lang::get('system::lang.locale.ro'),    'flag-ro'],
            'ru'    => [Lang::get('system::lang.locale.ru'),    'flag-ru'],
            'sk'    => [Lang::get('system::lang.locale.sk'),    'flag-sk'],
            'sv'    => [Lang::get('system::lang.locale.sv'),    'flag-se'],
            'tr'    => [Lang::get('system::lang.locale.tr'),    'flag-tr'],
            'uk'    => [Lang::get('system::lang.locale.uk'),    'flag-ua'],
            'vn'    => [Lang::get('system::lang.locale.vn'),    'flag-vn'],
            'zh-cn' => [Lang::get('system::lang.locale.zh-cn'), 'flag-cn'],
            'zh-tw' => [Lang::get('system::lang.locale.zh-tw'), 'flag-tw'],
        ];

        $locales = Config::get('app.localeOptions', $localeOptions);

        // Sort locales alphabetically
        asort($locales);

        return $locales;
    }
164931
public function getSupportedLanguages(): array
    {
        if (null === $this->supportedLanguages) {
            $this->supportedLanguages = [];
            $files = new \DirectoryIterator($this->getDictionaryFolder());
            foreach ($files as $file) {
                if ($file->getExtension() === 'aff') {
                    $this->supportedLanguages[] = $file->getBasename('.aff');
                }
            }
            sort($this->supportedLanguages);
        }

        return $this->supportedLanguages;
    }
1043955
public function getLanguagesWithMasterLanguagePromoted()
    {
        $languages = $this
            ->languageManager
            ->getLanguages()
            ->toArray();

        $masterLocale = $this
            ->masterLocale
            ->getIso();

        $index = array_search($masterLocale, $languages);

        if (false !== $index) {
            $mainLanguage = $languages[$index];
            unset($languages[$index]);
            array_unshift($languages, $mainLanguage);
        }

        return new ArrayCollection($languages);
    }
942467
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
332591
public static function getAvailableLanguages(){
        $languages = array();
        foreach(common_ext_ExtensionsManager::singleton()->getInstalledExtensions() as $extension){
           $localesDir = $extension->getDir() . 'locales/';
           foreach(glob($localesDir . '*') as  $file){
                if(is_dir($file) && file_exists($file . '/messages.po')){
                    $lang = basename($file);
                    if(!in_array($lang, $languages)){
                        $languages[] = $lang;
                    }
                }
           }
        } 
        return $languages;
    }
1317470
protected function buildAlternateTranslations()
    {
        $translations = [];

        $context  = $this->contextObject();
        $origLang = $this->currentLanguage();

        $this->translator()->isIteratingLocales = true;
        foreach ($this->locales() as $langCode => $localeStruct) {
            if ($langCode === $origLang) {
                continue;
            }

            $this->translator()->setLocale($langCode);

            $translations[$langCode] = $this->formatAlternateTranslation($context, $localeStruct);
        }

        $this->translator()->setLocale($origLang);
        unset($this->translator()->isIteratingLocales);

        return $translations;
    }
1027844
public static Set<Locale> getAvailableLocales() {
        Locale[] l = DecimalFormatSymbols.getAvailableLocales();
        Set<Locale> locales = new HashSet<>(l.length);
        Collections.addAll(locales, l);
        return locales;
    }
801469
public function getTranslations(): array
    {
        // Get english name
        $name = [
            'eng' => [
                'common' => $this->getName(),
                'official' => $this->getOfficialName(),
            ],
        ];

        // Get native names
        $natives = $this->getNativeNames() ?: [];

        // Get other translations
        $file = __DIR__.'/../resources/translations/'.mb_strtolower($this->getIsoAlpha2()).'.json';
        $translations = file_exists($file) ? json_decode(file_get_contents($file), true) : [];

        // Merge all names together
        $result = array_merge($translations, $natives, $name);

        // Sort alphabetically
        ksort($result);

        return $result;
    }
653103
public static function installedLocales(): Collection
    {
        return app(ModuleService::class)
            ->findByInterface(ModuleLanguageInterface::class, true)
            ->map(static function (ModuleLanguageInterface $module): LocaleInterface {
                return $module->locale();
            });
    }
426334
public function Locales()
    {
        $data = [];
        foreach (Locale::getCached() as $localeObj) {
            /** @var Locale $localeObj */
            $data[] = $this->owner->LocaleInformation($localeObj->getLocale());
        }
        return ArrayList::create($data);
    }
224653
public function getAllTranslations()
    {
        $this->loadTranslations($this->currentLanguage);

        if (!isset($this->translations[$this->currentLanguage])) {
            return array();
        }

        return $this->translations[$this->currentLanguage];
    }