Sets locale to use

@param string $locale

@return DateTimePicker
483438
public function setLocale(string $locale): DateTimePicker
    {
        $this->option_locale = $locale;
        $this->set_options['locale'] = 'locale';

        return $this;
    }
69694
public function setLocale($locale)
    {
        $locale = substr($locale, 0, 2);
        if (in_array($locale, $this->locales)) {
            $this->locale = $locale;
            return true;
        }
        return false;
    }
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;
    }
1249335
protected function setLocale($locale)
    {
        if (is_null($locale) || $locale === 'auto') {
            $locale = app()->getLocale();
        }

        $this->locale = $locale;

        return $this;
    }
1084302
public function setLocale($locale)
    {
        $locale = preg_replace_callback('/[-_]([a-z]{2,})/', function ($matches) {
            // _2-letters or YUE is a region, _3+-letters is a variant
            $upper = strtoupper($matches[1]);

            if ($upper === 'YUE' || $upper === 'ISO' || strlen($upper) < 3) {
                return "_$upper";
            }

            return '_'.ucfirst($matches[1]);
        }, strtolower($locale));

        if ($this->getLocale() === $locale) {
            return true;
        }

        if ($locale === 'auto') {
            $completeLocale = setlocale(LC_TIME, 0);
            $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale);
            $locales = $this->getAvailableLocales($locale);

            $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale);
            $getScore = function ($language) use ($completeLocaleChunks) {
                $chunks = preg_split('/[_.-]+/', $language);
                $score = 0;
                foreach ($completeLocaleChunks as $index => $chunk) {
                    if (!isset($chunks[$index])) {
                        $score++;

                        continue;
                    }
                    if (strtolower($chunks[$index]) === strtolower($chunk)) {
                        $score += 10;
                    }
                }

                return $score;
            };
            usort($locales, function ($a, $b) use ($getScore) {
                $a = $getScore($a);
                $b = $getScore($b);

                if ($a === $b) {
                    return 0;
                }

                return $a < $b ? 1 : -1;
            });
            $locale = $locales[0];
        }

        // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback
        if (strpos($locale, '_') !== false &&
            $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale))
        ) {
            parent::setLocale($macroLocale);
        }

        if ($this->loadMessagesFromFile($locale) || $this->initializing) {
            parent::setLocale($locale);

            return true;
        }

        return false;
    }
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'];
        }
    }
533737
public function setLocale(Locale $locale)
    {
        putenv('LANG='.$locale);
        setlocale(LC_ALL, [$locale.'.utf8', $locale]);
        $this->curLocale = $locale;
        $this->sessionSegment->set('locale', $locale);
    }
698335
public function withDateAtStartOfWeek(string $locale = null) : self
    {
        $instance = $this->withTimeAtMidnight();
        $calendar = $instance->toIntlCalendar($locale);
        
        $calendar->set(IntlCalendar::FIELD_DOW_LOCAL, 1);
        
        $instance->date->setTimestamp((int)($calendar->getTime() / 1000));
        
        return $instance;
    }
941920
public function setLocale($locale = null, $remember = false)
    {
        $this->_locale->setLocale($locale);
        $t = $this->getTranslator();
        if ($t->isAvailable($this->_locale))
            $t->setLocale($this->_locale);
        if ($remember) $this->_session->locale = $this->_locale->toString();
    }
1185231
public function locale($locale = null)
    {
        if ($locale) {
            // Normalize the language
            self::$locale = strtolower(str_replace([' ', '_'], '-', $locale));
        }

        return self::$locale;
    }
1013549
public function setContentLocale($locale)
    {
        Session::put('allLocalesInForm', false);
        if ($locale === 'all') {
            Session::put('allLocalesInForm', true);
        } else {
            Session::put('locale', $locale);
        }
    }
1278168
public function setLocale($locale)
	{
		if(is_string($locale))
			$locale=CLocale::getInstance($locale);
		$this->sizeFormat['decimalSeparator']=$locale->getNumberSymbol('decimal');
		$this->_locale=$locale;
	}
205388
public function setLocale($locale)
    {
        $this->locale = $locale;
        if ($this->coreFormatter instanceof Multilingual) {
            $this->coreFormatter->setLocale($locale);
        }
        if ($this->textProvider instanceof Multilingual) {
            $this->textProvider->setLocale($locale);
        }
        return $this;
    }
825598
public function joinTranslations($locale)
    {
        $this->getInstance()
            ->innerJoin($this->mainAlias.'.translations', 'translation', Expr\Join::WITH, 'translation.locale = :locale')
            ->setParameter('locale', $locale);

        return $this;
    }
82000
public static function setFallbackLocale($locale)
    {
        $translator = static::getTranslator();

        if (method_exists($translator, 'setFallbackLocales')) {
            $translator->setFallbackLocales([$locale]);

            if ($translator instanceof Translator) {
                $preferredLocale = $translator->getLocale();
                $translator->setMessages($preferredLocale, array_replace_recursive(
                    $translator->getMessages()[$locale] ?? [],
                    Translator::get($locale)->getMessages()[$locale] ?? [],
                    $translator->getMessages($preferredLocale)
                ));
            }
        }
    }
566969
public static function with_locale($locale, $callback)
    {
        $oldLocale = self::$current_locale;
        static::set_locale($locale);
        try {
            return $callback();
        } finally {
            static::set_locale($oldLocale);
        }
    }
1192046
public function setLocale($locale = null)
    {

        $this->_locale = Zend_Locale::findLocale($locale);
        $locale        = new Zend_Locale($this->_locale);
        $region        = $locale->getRegion();
        if (empty($region)) {

            throw new Zend_Validate_Exception("Unable to detect a region for the locale '$locale'");
        }

        $format = Zend_Locale::getTranslation(
            $locale->getRegion(),
            'postaltoterritory',
            $this->_locale
        );

        if (empty($format)) {

            throw new Zend_Validate_Exception("Unable to detect a postcode format for the region '{$locale->getRegion()}'");
        }

        $this->setFormat($format);
        return $this;
    }