@param string|null $localeIdentifier

@return self
172600
private function setLocaleIdentifier(?string $localeIdentifier): self
    {
        $this->updatePropertyValue(
            LocaleIdentifierFieldInterface::PROP_LOCALE_IDENTIFIER,
            $localeIdentifier
        );

        return $this;
    }
1193885
public function setLocale(string $locale): self
	{
		if ($locale === '') {
			$this->locale = $locale;
		} else {
			if (!\Locale::parseLocale($locale)) {
				throw new \InvalidArgumentException(sprintf('Invalid locale "%s"', $locale));
			}
			$this->locale = \Locale::canonicalize($locale);
		}

		$this->setOptions['locale'] = null;

		return $this;
	}
463509
public function setLocale($locale = null)
    {
        if (class_exists('\Locale')) {
            $this->locale = \Locale::lookup(
                $this->getAvailableLocales(),
                $locale,
                true,
                $this->getSettings()->locale->default
            );
        }

        if (empty($this->locale)) {
            $this->locale = $this->getSettings()->locale->default;
        }

        // Set up locale environment for gettext.
        bindtextdomain(self::TEXT_DOMAIN_NAME, self::TEXT_DOMAIN_LOCATION);
        bind_textdomain_codeset(self::TEXT_DOMAIN_NAME, 'UTF-8');
        textdomain(self::TEXT_DOMAIN_NAME);
        putenv('LANG=' . $this->locale);
        putenv('LC_MESSAGES=' . $this->locale);
        $locale = setlocale(LC_MESSAGES, $this->locale);

        Logger::get()->info(sprintf('Locale is now %s [%s] (domain "%s" at %s)',
            $locale,
            $this->locale,
            self::TEXT_DOMAIN_NAME,
            realpath(self::TEXT_DOMAIN_LOCATION)
        ));
    }
599069
protected function registerLocalizer()
    {
        $this->app->bind(Localizer::class, function ($app) {
            $locales = $app['config']->get("{$this->name}.supported-locales");
            $detectors = $app['config']->get("{$this->name}.detectors");
            $stores = $app['config']->get("{$this->name}.stores");

            return new Localizer($locales, $detectors, $stores);
        });
    }
727442
public function create(string $locale = FakerFactory::DEFAULT_LOCALE): FakerGenerator
    {
        $locale = str_replace('-', '_', $locale);

        return tap(FakerFactory::create($locale), function (FakerGenerator $faker) use ($locale) {
            $this->dispatcher->triggerEvent('afterFakerCreated', ['faker' => $faker, 'locale' => $locale]);
        });
    }
496217
public function setLocale($locale)
    {
        if ($this->isRoot) {
            $this->translator->setLocale($locale);

            return $this;
        }

        $this->locale = $locale;

        return $this;
    }
717427
public function setLocation($location): self
    {
        if ($location instanceof LocationResponse) {
            $this->setLocationResponse($location);

            return $this;
        }

        if ($location instanceof StopLocationResponse) {
            $this->setStopResponse($location);

            return $this;
        }

        if (\is_int($location) || \is_string($location)) {
            $this->setLocationId($location);

            return $this;
        }

        throw new \InvalidArgumentException(
            'The location must be either a LocationResponse object, StopLocationResponse object, string or integer'
        );
    }
1279183
public static function get($locale = null)
    {
        $locale = $locale ?: 'en';

        if (!isset(static::$singletons[$locale])) {
            static::$singletons[$locale] = new static($locale ?: 'en');
        }

        return static::$singletons[$locale];
    }
578017
public function removeTranslation($locale = null) {
        $translation = $this->translate($locale);

        if(! is_null($translation))
            $translation->delete();

        return $this;
    }
1367371
public function forLocale($locale, $fallbacks = null)
    {
        $fork = new static(
            $this->coreFormatter,
            $this->extractor,
            $this->typeProvider,
            $this->textProvider,
            $this->_extensions
        );

        if ($fallbacks) {
            $fork->setFallbacks((array)$fallbacks);
        }

        return $fork->setLocale($locale);
    }
15955
private function locateLanguageFile($localeID)
    {
        $localeIDAlternatives = $this->getLocaleIDAlternatives($localeID);
        $result = null;
        foreach ($localeIDAlternatives as $localeIDAlternative) {
            $languageFile = $this->getLanguageFilePath($localeIDAlternative);
            if (is_file($languageFile)) {
                $result = $languageFile;
                break;
            }
        }

        return $result;
    }
1213051
public function addPreinitLocale($locale) {
		$locale = (string) $locale;
		
		if (in_array($locale, $this->preinitLocales, true)) {
			return $this;
		}
		
		$this->preinitLocales[] = $locale;
		$this->preinitNeed      = true;
		
		return $this;
	}
1036093
public function setCurrent($locale)
	{
		$localeIdentifier = null;

		if ($locale instanceof LocaleInterface) {
			$localeIdentifier = $locale->getId();
		} else {
			$localeIdentifier = $locale;
		}

		$this->current = $this->getLocale($localeIdentifier);
	}
698956
public function setLocale($locale = null)
    {
        if ($locale === null) {
            $this->_locale = null;
            return $this;
        }

        include_once 'Zend/Locale.php';
        if (!Zend_Locale::isLocale($locale, true)) {
            if (!Zend_Locale::isLocale($locale, false)) {
                include_once 'Zend/Validate/Exception.php';
                throw new Zend_Validate_Exception("The locale '$locale' is no known locale");
            }

            $locale = new Zend_Locale($locale);
        }

        $this->_locale = (string) $locale;
        return $this;
    }
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;
    }
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();
    }
309476
public function setTwitterCreator($twitterCreator, $locale = null)
    {
        $this->translate($locale, false)->setTwitterCreator($twitterCreator);
        $this->mergeNewTranslations();

        return $this;
    }