Get the default locale, aka, the first locales array key

@return string
340494
public function defaultLocale()
    {
        if (($locales = Config::get('decoy.site.locales'))
            && is_array($locales)) {
            reset($locales);

            return key($locales);
        }
    }
1014302
public function getLanguageKey()
    {
        $languageKey = 'unknown';

        if ($this->environmentService->isEnvironmentInFrontendMode()) {
            $pageController = Core::get()->getPageController();

            if (isset($pageController->config['config']['language'])) {
                $languageKey = $pageController->config['config']['language'];
            }
        } else {
            $backendUser = Core::get()->getBackendUser();

            if (strlen($backendUser->uc['lang']) > 0) {
                $languageKey = $backendUser->uc['lang'];
            }
        }

        return $languageKey;
    }
370817
public function getLocale()
    {
        $auth = $this->getView()
                     ->authentication();

        if ( $auth->hasIdentity() )
        {
            $locale = $auth->getIdentity()->locale;
        }
        else
        {
            $locale = Locale::getDefault();
        }

        return $locale;
    }
556472
public function DefaultLocale()
    {
        // Return explicit default locale
        if ($this->DefaultLocaleID) {
            $locale = Locale::getCached()->byID($this->DefaultLocaleID);
            if ($locale) {
                return $locale;
            }
        }

        // Use IsGlobalDefault if this is a member of this locale, or the first in the list of children
        $locales = Locale::getCached()->filter('DomainID', $this->ID);
        return $locales->filter('IsGlobalDefault', 1)->first()
            ?: $locales->first();
    }
576455
public function getDefaultLanguage()
    {
        if (!$this->defaultLanguage) {
            $language = substr(setlocale(LC_ALL, 0), 0, 2);
            $languages = $this->getLanguages();
            $languageDefault = reset($languages);
            $language = $this->isValidLanguage($language) ? $language : $languageDefault;
            $this->setDefaultLanguage($language);
        }

        return $this->defaultLanguage;
    }
679697
public function getLocale($defaultLocale)
    {
        if ($this->hasCriteriaNamed('locale')) {
            foreach ($this->getCriterias() as $criteria) {
                if ($criteria->getName() === 'locale' && $criteria->getValue() === $defaultLocale) {
                    return $criteria->getValue();
                }
            }
        }

        return $defaultLocale;
    }
226324
protected function _localesPattern()
    {
        $cacheKey = '_localesPattern';
        $cache = static::cache($cacheKey);
        if ($cache) {
            return $cache;
        }

        $pattern = '(' . implode(
            '|',
            array_map(
                'preg_quote',
                array_keys(
                    quickapps('languages')
                )
            )
        ) . ')';

        return static::cache($cacheKey, $pattern);
    }
827213
public function getCurrentLocale()
    {
        if (is_null($this->currentLocale)) {
            $this->setCurrentLocaleByContext();

            if (!is_admin() || Router::isFrontendAjax()) {
                $this->applyLocale();
            }
        }

        return $this->currentLocale;
    }
1315151
def get_locale ():
    """"""
    try:
        loc, encoding = locale.getdefaultlocale()
    except ValueError:
        # locale configuration is broken - ignore that
        loc, encoding = None, None
    if loc is None:
        loc = "C"
    else:
        loc = norm_locale(loc)
    if encoding is None:
        encoding = "ascii"
    return (loc, encoding)
1165612
public function getCurrentLocale()
    {
        if ( ! is_null($this->currentLocale))
            return $this->currentLocale;

        if ($this->useAcceptLanguageHeader())
            return $this->negotiateLocale();

        // Get application default language
        return $this->getDefaultLocale();
    }
124360
public static function locale()
    {
        if (!self::isDebug()) {
            return false;
        }

        ob_start();
        @system('locale -a');
        $locale = explode(PHP_EOL, trim(ob_get_contents()));
        ob_end_clean();

        $result = array(
            'list' => $locale,
            'conv' => @localeconv()
        );

        return self::i()->dump($result, '! locale info !');
    }
283264
public function getDefaultResourceForLocale( $locale )
    {
        $resource = null;

        if( $this->getValue() && !$this->getValue()->isEmpty() )
        {
            foreach( $this->getValue() as $index => $item )
            {
                if( $item->{$this->getModel()->getLocaleKey()} === $locale )
                {
                    $resource = $item;
                }
            }
        }

        return $resource;
    }
782513
protected function getLanguage()
    {
        $output = [];
        // Get the language that be for default.
        $default_id = $this->languageManager->getDefaultLanguage()->getId();
        foreach ($this->languageManager->getLanguages() as $key => $value) {
            if ($default_id == $key) {
                $output[] = '';
            } else {
                $output[] = 'language.' . $value->getId();
            }
        }
        return $output;
    }
1348213
public function getClientPreferredLocale()
    {
        if (null !== $this->locale) {
            $locale = $this->locale;

        } else {
            // Get detector
            $detector = $this->getDetector();

            // Detect user's preferred locale
            $detector->detect();

            // get the locale from detector
            $locale = $detector->getLocale();
        }

        // return the active locale
        return $locale;
    }
769768
public function getLocales()
	{
		$currentLocales = array();
		
		foreach($this->localeCategories as $category) {
			if($category === LC_ALL)
				continue;
			
			$currentLocales[$category] = setlocale($category, 0);
		}
		
		return $currentLocales;
	}
153212
public function getCurrentLocale()
    {
        if (!$this->currentLocale instanceof Locale
            || $this->currentLocale->getLanguage() === 'mul') {
            return $this->defaultLocale;
        }
        return $this->currentLocale;
    }
1321118
public static function getLocaleString(string $default = 'en-US'): string
    {
        $i18n = static::get('i18n', null, false);

        return $i18n ? (string)$i18n->getLocale() : $default;
    }