Returns an array of languages
@param array $options
@return array
763719
public function getList(array $options = array())
    {
        $options += array(
            'enabled' => false,
            'in_database' => false
        );

        $languages = &gplcart_static(gplcart_array_hash(array('language.list' => $options)));

        if (isset($languages)) {
            return $languages;
        }

        $this->hook->attach('language.list.before', $options, $languages, $this);

        if (isset($languages)) {
            return (array) $languages;
        }

        $iso = $this->getIso();
        $default_code = $this->getDefault();
        $default_data = $this->getDefaultData();
        $saved = $this->config->get('languages', array());
        $languages = array_replace_recursive($iso, $saved);

        $this->hook->attach('language.list.after', $options, $languages, $this);

        foreach ($languages as $code => &$language) {

            $language['code'] = $code;
            $language += $default_data;
            $language['default'] = ($code == $default_code);
            $language['in_database'] = isset($saved[$code]);

            if (empty($language['native_name'])) {
                $language['native_name'] = $language['name'];
            }

            if ($options['enabled'] && empty($language['status'])) {
                unset($languages[$code]);
                continue;
            }

            if ($options['in_database'] && empty($language['in_database'])) {
                unset($languages[$code]);
            }
        }

        gplcart_array_sort($languages);
        return $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;
    }
1324977
public function errors($options = [])
    {
        $errors = [];
        $errored = false;
        foreach ($this as $entity) {
            $result = $entity->errors($options);
            $errors[] = $result;
            if ($result) {
                $errored = true;
            }
        }
        return $errored ? $errors : [];
    }
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;
    }
297569
public function getArray(array $options = array()): array
    {
        $content = $this->getContent();

        if (is_null($content)) {
            return (array)$content;
        }

        return json_decode($this->content, true);
    }
1368013
public function toArray(array $options = [])
    {
        $childrenIds = [];

        /** @var NodeInterface $child */
        foreach ($this->getChildren() as $child) {
            $childrenIds[] = $child->getId();
        }

        return [
            'id'                => $this->getId(),
            'name'              => $this->getName(),
            'type'              => $this->getType(),
            'metadata'          => $this->getMetadata()->getData(),
            'parentId'          => $this->getParent() ?
                $this->getParent()->getId() :
                null,
            'childrenIds'       => $childrenIds
        ];
    }
129399
public function getOptions($options)
    {
        // Add verify to options
        $options = array_merge(['verify' => $this->verify], $options);

        if ($this->async) {
            $options = array_merge(['future' => true], $options);
        }

        // merge and return
        return array_merge_recursive($this->options, $options);
    }
1293512
public function checkMessages(array $options = [])
    {
        $this->buildCall('/text');

        $rawMessages = $this->getRequest()->xml();

        return $this->makeMessages($rawMessages->Text);
    }
921692
protected function parseOptions($options)
    {
        return collect(explode(';', $options))->mapWithKeys(function ($option) {
            $data = explode('=', $option, 2);

            return [$data[0] => $data[1] ?? true];
        })->all();
    }
219168
protected function transferOptionsToLabels(array $options)
    {
        $finalOptions = [];
        $index = 0;

        foreach ($options as $value => $option) {

            if (!is_array($option)) {
                // At this point the options are plain text without locale
                $finalOptions[] = new Label($option, $this->localeGroup, true, $this->defaultLang, null, $value);
                continue;
            }

            $optionLang = $value;
            foreach ($option as $optionValue => $text) {
                // At this point the options are in array which mean they need translation.
                $finalOptions[] = new Label($text, $this->localeGroup, false, $optionLang, null, $optionValue);
            }
        }

        return $finalOptions;
    }
969744
protected function initArrayCallbackOption($options)
    {
        if (!isset($options['callback']) && !isset($options['groups']) && \is_callable($options)) {
            $options = ['callback' => $options];
        }

        return $options;
    }
935273
private function getDefaultHttpClientOptions(array $options = []): array
    {
        $headers = [];

        if ($this->token !== null) {
            $headers['Authorization'] = 'Bearer '.$this->token;
        }

        $languagesInOptions = (array_key_exists('headers', $options) &&
            array_key_exists('Accept-Language', $options['headers']));
        if ($this->languages !== null && $languagesInOptions === false) {
            $headers['Accept-Language'] = join(', ', $this->languages);
        }

        if ($this->version !== null) {
            $headers['Accept'] = 'application/vnd.thetvdb.v'.$this->version;
        }

        $options['http_errors'] = false;

        return array_merge_recursive(['headers' => $headers], $options);
    }
703638
public function listCollections(array $options = [])
    {
        $this->setOptions($options);
        $coll = new Collection($this->client, $this->database);
        $coll->setHeaders($this->getHeaders());
        $rs = $coll->getAll();
        $this->checkResponse($rs);
        $colls = array_get($rs, 'DocumentCollections');
        $list = [];
        if (!empty($colls)) {
            foreach ($colls as $coll) {
                $list[] = array_get($coll, 'id');
            }
        }

        return $list;
    }
1206830
static function languageList( $withVariations = true )
    {
        $languages =& $GLOBALS['eZLocaleLanguageist'];
        if ( !is_array( $languages ) )
        {
            $localeRegexp = eZLocale::localeRegexp( $withVariations, false );
            $languages = array();
            $dir = opendir( 'share/locale' );
            while( ( $file = readdir( $dir ) ) !== false )
            {
                if ( preg_match( "/^$localeRegexp\.ini$/", $file, $regs ) )
                {
                    $languages[] = $regs[1];
                }
            }
            closedir( $dir );
            $languages = array_unique( $languages );
            sort( $languages );
        }
        return $languages;
    }
388249
protected function buildOptionsList(array $options): string
	{
		$output = '';

		foreach($options as $key => $option)
		{
			$output .= ($key + 1) . ') ' . $option . PHP_EOL;
		}

		return $output . '> ';
	}
980395
public function actionTranslation($options)
    {
        if (!is_array($options)) {
            return $this->translator->trans($options, [], 'CmsKernelAdminBridge');
        }

        $resultOptions = [];
        foreach ($options as $optionKey => $option) {
            $option = null === json_decode($option, true) ? $option : json_decode($option, true);

            if (is_array($option)) {
                foreach ($option as $iterationKey => $iteration) {
                    if (is_array($iteration)) {
                        foreach ($iteration as $iKey => $i) {
                            if (is_array($i)) {
                                foreach ($i as $iiKey => $ii) {
                                    $resultOptions[$optionKey][$iterationKey][$iKey][$iiKey] = $this->translator->trans($ii, [], 'CmsKernelAdminBridge');
                                }
                            } else {
                                $resultOptions[$optionKey][$iterationKey][$iKey] = $this->translator->trans($i, [], 'CmsKernelAdminBridge');
                            }
                        }
                    } else {
                        $resultOptions[$optionKey][$iterationKey] = $this->translator->trans($iteration, [], 'CmsKernelAdminBridge');
                    }
                }
            } else {
                $resultOptions[$optionKey] = $this->translator->trans($option, [], 'CmsKernelAdminBridge');
            }
        }

        return $resultOptions;
    }
936965
protected function getCellOptions($options)
    {
        $cellOptions = $options['cell-options'];

        $inheritableOptions = $this->getInheritableOptions();

        foreach ($inheritableOptions as $inheritableOption) {
            $cellOptions[$inheritableOption] =
                isset($cellOptions[$inheritableOption])
                ? $cellOptions[$inheritableOption]
                : $options[$inheritableOption];
        }

        if (isset($cellOptions['translate_content']) && $cellOptions['translate_content']) {
            $cellOptions['translator'] = $this->translator;
        }

        return $cellOptions;
    }