Checks the user locale preference and updates $oLocale object

@param \Nails\Common\Factory\Locale $oLocale The locale object to update

@return $this
542254
public function sniffActiveUser(\Nails\Common\Factory\Locale &$oLocale)
    {
        $this->setFromString(
            $oLocale,
            activeUser('locale') ?? ''
        );

        return $this;
    }
147297
public static function flagEmoji(\Nails\Common\Factory\Locale $oLocale): string
    {
        $sRegion    = $oLocale->getRegion();
        $aCountries = json_decode(
            file_get_contents(
                NAILS_APP_PATH . 'vendor/annexare/countries-list/dist/countries.emoji.json'
            )
        );

        return !empty($aCountries->{$sRegion}->emoji) ? $aCountries->{$sRegion}->emoji : '';
    }
388471
public function setLocale($locale)
    {
        foreach ($this->datas as $data) {
            $data->getDefinition()->setLocale($locale);
        }
    }
235940
public function getUrlSegment(\Nails\Common\Factory\Locale $oLocale): string
    {
        if ($oLocale == $this->getDefautLocale()) {
            return '';
        } else {
            return getFromArray((string) $oLocale, static::URL_VANITY_MAP, (string) $oLocale);
        }
    }
361842
public function setLocale($locale) {
		$this->locale = $locale;
		
		if ($this->checkTranslateObjectIsSet()) {
			$this->translation->setLocale($this->locale);
		}
	}
533737
public function setLocale(Locale $locale)
    {
        putenv('LANG='.$locale);
        setlocale(LC_ALL, [$locale.'.utf8', $locale]);
        $this->curLocale = $locale;
        $this->sessionSegment->set('locale', $locale);
    }
1073188
private function setLocale(string $locale)
    {
        $arr = \Locale::parseLocale($locale);
        
        if ($arr === false) {
            throw new \InvalidArgumentException('Invalid locale');
        }
        
        $this->locale = $arr;
    }
496217
public function setLocale($locale)
    {
        if ($this->isRoot) {
            $this->translator->setLocale($locale);

            return $this;
        }

        $this->locale = $locale;

        return $this;
    }
1278168
public function setLocale($locale)
	{
		if(is_string($locale))
			$locale=CLocale::getInstance($locale);
		$this->sizeFormat['decimalSeparator']=$locale->getNumberSymbol('decimal');
		$this->_locale=$locale;
	}
650461
public function locale($locale = null)
    {
        if ($locale) {
            $this->_locale = $locale;
        }
        if ($this->_locale) {
            return $this->_locale;
        }
        if (isset($this->_params['locale'])) {
            return $this->_params['locale'];
        }
    }
463908
public static function setDefaultLocale($locale)
		{

			static::$_defaultLocale = $locale;
			
			// Apply to PHP locale
			if (is_null(static::$_locale)) {
				$sysLocales = \ChickenWire\Application::getConfiguration()->systemLocales;
				if (array_key_exists($locale, $sysLocales)) {
					setlocale(LC_ALL, $sysLocales[$locale]);
				}				
			}
		}
393153
public function addLocale($locale)
    {
        // Get sanitized locale
        $locale = Locale::sanitizeLocale($locale);

        if (!isset($this->available[$locale])) {
            $locale = new Locale($locale);

            $this->available[$locale->getLocale()] = $locale;
        }

        return $this;
    }
833637
public function setLocale(Locale $locale)
    {
        $this->currentLocale = $locale;
        $this->saveCurrentLocaleToSession();

        return $this->currentLocale;
    }
592448
public function setLocale($locale)
    {
        if ($locale && !preg_match('/[a-z]{2,3}/', $locale)) {
            throw new \InvalidArgumentException('Locale must be a valid i18n code');
        }

        $this->i18n = $locale;

        return $this;
    }
387040
public function withLocale($locale, $callback)
    {
        if (! $locale) {
            return $callback();
        }

        $app = Container::getInstance();

        $original = $app->getLocale();

        try {
            $app->setLocale($locale);

            return $callback();
        } finally {
            $app->setLocale($original);
        }
    }
1222235
private function getFromCache( $locale, $context )
    {
        if ( isset( $this->contextCache[$locale][$context] ) )
        {
            return $this->contextCache[$locale][$context];
        }
        return null;
    }
286705
public function setLocale($locale)
    {
        if (!$this->catalogueManager->has($locale)) {
            throw new LocaleException($locale);
        }

        $this->locale = $locale;
        $this->catalogueManager->load($locale);

        return $this;
    }