Get Google Maps API languages

@return array
@codeCoverageIgnore
334187
public function getGoogleMapAddressLanguage()
    {
        return $this->scopeConfig->getValue(
            self::XML_GOOGLE_MAP_ADDRESS_LANGUAGE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
188840
public function getAvailableLanguages()
    {
        if (!empty($this->owner->{$this->translationsAttribute})) {
            return array_keys($this->owner->{$this->translationsAttribute});
        }
        return null;
    }
675203
protected function getListLanguage()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->language->getList();
            $this->limitArray($list);
            return $list;
        }

        $result = $this->language->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
1047560
public function getLanguages()
    {
        $url = $this->getGetLanguagesUrl();
        $response = $this->sendRequest(
            'GET',
            $url,
            [
                'version' => $this->serviceProtocolVersion
            ]
        );
        if ($response->getStatusCode() === 200) {
            $languages = $this->parseGetLanguagesResponse($response);
            return $languages;
        }
        return false;
    }
623032
public static function getAll()
    {
        $result = [];
        foreach (\array_keys(CldrData::getLanguageNames()) as $cldrLanguageId) {
            $result[] = new Language(CldrData::getLanguageInfo($cldrLanguageId));
        }

        return $result;
    }
1272480
protected function getLanguages()
    {
        // Check if we have the data in the cache.
        if (null !== $this->languageCache) {
            return $this->languageCache;
        }

        $loadedLanguage = $this->getMetaModel()->getActiveLanguage();
        $languageValues = $this->getLanguageNames($loadedLanguage);
        $languages      = $this->getRealLanguages();
        $keys           = \array_keys($languages);
        $aux            = [];
        $real           = [];

        // Fetch real language values.
        foreach ($keys as $key) {
            if (isset($languageValues[$key])) {
                $aux[$key]  = \utf8_romanize($languageValues[$key]);
                $real[$key] = $languageValues[$key];
            }
        }

        // Add needed fallback values.
        $keys = \array_diff($keys, \array_keys($aux));
        if ($keys) {
            $this->addNeededFallbackLanguages($keys, $aux, $real);
        }

        $keys = \array_diff($keys, \array_keys($aux));
        if ($keys) {
            foreach ($keys as $key) {
                $aux[$key]  = \utf8_romanize($languages[$key]);
                $real[$key] = $languages[$key];
            }
        }

        \asort($aux);
        $return = [];
        foreach (\array_keys($aux) as $key) {
            $return[$key] = $real[$key];
        }

        // Switch back to the original FE language to not disturb the frontend.
        if ($loadedLanguage != $GLOBALS['TL_LANGUAGE']) {
            $event = new LoadLanguageFileEvent('languages', null, true);
            $this->eventDispatcher->dispatch(ContaoEvents::SYSTEM_LOAD_LANGUAGE_FILE, $event);
        }

        return $this->languageCache = $return;
    }
367217
public function getLanguages()
    {
        // Cache by locale
        $locale = i18n::get_locale();
        if (!empty(static::$cache_languages[$locale])) {
            return static::$cache_languages[$locale];
        }

        // Localise all languages
        $languages = $this->config()->get('languages');
        $localised = [];
        foreach ($languages as $code => $default) {
            $localised[$code] = $this->languageName($code);
        }

        // Save cache
        static::$cache_languages[$locale] = $localised;
        return $localised;
    }
1041707
public function getCustomerLang()
    {
        $lang = $this->getLangModel();

        if ($lang === null) {
            $lang = (new LangQuery)
                ->filterByByDefault(1)
                ->findOne()
            ;
        }

        return $lang;
    }
859658
public function userLanguages() {
        if (isset($this->serverVariables['HTTP_ACCEPT_LANGUAGE'])) {
            preg_match_all(
                '/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
                $this->serverVariables['HTTP_ACCEPT_LANGUAGE'],
                $matches
            );

            if (count($matches[1])) {
                $result = array_combine($matches[1], $matches[4]);

                array_walk($result, function($lang, $amount) {
                    if ($amount === '') {
                        $langs[$lang] = 1;
                    }
                });

                arsort($result, \SORT_NUMERIC);

                return $result;
            }
        }

        return array();
    }
465749
public function get_primaries_langs(){
    $uid_languages =  self::get_appui_option_id('languages');
    $languages = options::get_instance()->full_tree($uid_languages);
    $primaries = array_values(array_filter($languages['items'], function($v) {
      return !empty($v['primary']);
    }));
    return $primaries;
  }
1253019
public function getLanguageNames()
    {
        $aConfLanguages = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aLanguages');
        $aLangIds = $this->getLanguageIds();
        $aLanguages = [];
        foreach ($aLangIds as $iId => $sValue) {
            $aLanguages[$iId] = $aConfLanguages[$sValue];
        }

        return $aLanguages;
    }
527487
public function getAdminLanguages() {
        $response=CodeBank_ClientAPI::responseBase();
        
        $languages=SnippetLanguage::get();
        foreach($languages as $lang) {
            $response['data'][]=array(
                                    'id'=>$lang->ID,
                                    'language'=>$lang->Name,
                                    'file_extension'=>$lang->FileExtension,
                                    'shjh_code'=>$lang->HighlightCode,
                                    'user_language'=>$lang->UserLanguage,
                                    'snippetCount'=>$lang->Snippets()->Count(),
                                    'hidden'=>$lang->Hidden
                                );
        }
        
        
        return $response;
    }
1082035
public function getLanguage() {
		if($this->language)
			return $this->language;
			
		// getting http instruction if not provided
		$str=(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])?$_SERVER['HTTP_ACCEPT_LANGUAGE']:"");
		// exploding accepted languages
		$langs=explode(',',$str);
		// creating output list
		$accepted=array();
		foreach ($langs as $lang) {
			// parsing language preference instructions
			// 2_digit_code[-longer_code][;q=coefficient]
			preg_match('/([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?/',$lang,$found);
			//ereg('([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?',$lang,$found);
			// 2 digit lang code
			$code=isset($found[1])?$found[1]:null;
			// lang code complement
			$morecode=isset($found[3])?$found[3]:null;
			// full lang code
			$fullcode=$morecode?$code.'-'.$morecode:$code;
			// coefficient
			$coef=sprintf('%3.1f',isset($found[5])?$found[5]:'1');
			// for sorting by coefficient
			// adding
			$accepted[]=array('code'=>$code,'coef'=>$coef,'morecode'=>$morecode,'fullcode'=>$fullcode);
		}
		// sorting the list by coefficient desc
		krsort($accepted);
		if (isset($accepted[0])) {
			$this->language = $accepted[0]['code'];
		}
		
		return $this->language;
	}
66832
public function getAvailableInLangs()
    {
        $languages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames();

        $objFields = $this->_getTableFields(
            getViewName($this->_sCoreTable, -1, -1),
            true
        );
        $multiLangFields = [];

        //selecting all object multilang fields
        foreach ($objFields as $key => $value) {
            //skipping oxactive field
            if (preg_match('/^oxactive(_(\d{1,2}))?$/', $key)) {
                continue;
            }

            $fieldLang = $this->_getFieldLang($key);

            //checking, if field is multilanguage
            if ($this->isMultilingualField($key) || $fieldLang > 0) {
                $newKey = preg_replace('/_(\d{1,2})$/', '', $key);
                $multiLangFields[$newKey][] = (int) $fieldLang;
            }
        }

        // if no multilanguage fields, return default languages array
        if (count($multiLangFields) < 1) {
            return $languages;
        }

        // select from non-multilanguage core view (all ml tables joined to one)
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
        $query = "select * from " . getViewName($this->_sCoreTable, -1, -1) . " where oxid = " . $db->quote($this->getId());
        $rs = $db->getAll($query);

        $notInLang = $languages;

        // checks if object field data is not empty in all available languages
        // and formats not available in languages array
        if (isset($rs[0]) && is_array($rs[0]) && count($rs[0])) {
            foreach ($multiLangFields as $fieldId => $multiLangIds) {
                foreach ($multiLangIds as $multiLangId) {
                    $fieldName = ($multiLangId == 0) ? $fieldId : $fieldId . '_' . $multiLangId;
                    if ($rs[0][strtoupper($fieldName)]) {
                        unset($notInLang[$multiLangId]);
                        continue;
                    }
                }
            }
        }

        return array_diff($languages, $notInLang);
    }
1096307
public function getLanguages() {

		if (NULL === $this->languages) {

			$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all();
			$this->languages = [];

			foreach (array_keys($languages) as $lang) {

				if (FALSE !== strpos($lang, '-')) {

					$codes = explode('-', $lang);

					if ('i' === $codes[0]) {
						// Language not listed in ISO 639 that are not variants
						// of any listed language, which can be registered with the
						// i-prefix, such as i-cherokee
						if (count($codes) > 1) {
							$lang = $codes[1];
						}
					}
					else {
						for ($i = 0, $max = count($codes); $i < $max; ++$i) {
							if (!$i) {
								$lang = strtolower($codes[0]);
							}
							else {
								$lang .= '_' . strtoupper($codes[$i]);
							}
						}
					}
				}
	
				$this->languages[] = $lang;
			}
		}

		return $this->languages;

	}
556887
public static function getLocales()
    {
        $localeDir     = __DIR__.'/../locales';
        $languageFiles = scandir($localeDir);
        $locales       = [];
        foreach ($languageFiles as $languageFile) {
            if (in_array($languageFile, ['.', '..'])) {
                continue;
            }
            $extensionPos = strpos($languageFile, '.yml');
            if ($extensionPos !== false) {
                $locale    = substr($languageFile, 0, $extensionPos);
                $locales[] = $locale;
            }
        }
        sort($locales);
        return $locales;
    }
422069
protected function _getLanguagesList()
    {
        $aLangParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aLanguageParams');
        $aLanguages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageArray();
        $sDefaultLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultLang');

        foreach ($aLanguages as $sKey => $sValue) {
            $sOxId = $sValue->oxid;
            $aLanguages[$sKey]->active = (!isset($aLangParams[$sOxId]["active"])) ? 1 : $aLangParams[$sOxId]["active"];
            $aLanguages[$sKey]->default = ($aLangParams[$sOxId]["baseId"] == $sDefaultLang) ? true : false;
            $aLanguages[$sKey]->sort = $aLangParams[$sOxId]["sort"];
        }

        if (is_array($aLangParams)) {
            $aSorting = $this->getListSorting();

            if (is_array($aSorting)) {
                foreach ($aSorting as $aFieldSorting) {
                    foreach ($aFieldSorting as $sField => $sDir) {
                        $this->_sDefSortField = $sField;
                        $this->_sDefSortOrder = $sDir;

                        if ($sField == 'active') {
                            //reverting sort order for field 'active'
                            $this->_sDefSortOrder = 'desc';
                        }
                        break 2;
                    }
                }
            }

            uasort($aLanguages, [$this, '_sortLanguagesCallback']);
        }

        return $aLanguages;
    }