Require that this record is saved in the given locale for it to be visible

@return bool
167821
protected function requireSavedInLocale()
    {
        if (FluentState::singleton()->getIsFrontend()) {
            return $this->owner->config()->get('frontend_publish_required');
        }

        return $this->owner->config()->get('cms_publish_required');
    }
793151
protected function _checkLocale()
	{
		$errors = array();
		$context = $this->_getContext();
		$session = $context->getSession();
		$locale = $this->_basket->getLocale();

		$localeStr = $session->get( 'arcavias/basket/locale' );
		$localeKey = $locale->getSite()->getCode() . '|' . $locale->getLanguageId() . '|' . $locale->getCurrencyId();

		if( $localeStr !== null && $localeStr !== $localeKey )
		{
			$locParts = explode( '|', $localeStr );
			$locSite = ( isset( $locParts[0] ) ? $locParts[0] : '' );
			$locLanguage = ( isset( $locParts[1] ) ? $locParts[1] : '' );
			$locCurrency = ( isset( $locParts[2] ) ? $locParts[2] : '' );

			$localeManager = MShop_Factory::createManager( $context, 'locale' );
			$locale = $localeManager->bootstrap( $locSite, $locLanguage, $locCurrency, false );

			$context = clone $context;
			$context->setLocale( $locale );

			$manager = MShop_Order_Manager_Factory::createManager( $context )->getSubManager( 'base' );
			$basket = $manager->getSession();

			$errors = $this->_copyAddresses( $basket, $errors, $localeKey );
			$errors = $this->_copyServices( $basket, $errors );
			$errors = $this->_copyProducts( $basket, $errors, $localeKey );
			$errors = $this->_copyCoupons( $basket, $errors, $localeKey );

			$manager->setSession( $basket );
		}

		$session->set( 'arcavias/basket/locale', $localeKey );

		if( !empty( $errors ) )
		{
			$msg = $context->getI18n()->dt(
				'controller/frontend',
				sprintf( 'One or more items aren\'t available for the chosen locale' )
			);
			throw new Controller_Frontend_Basket_Exception( $msg, 0, null, $errors );
		}
	}
1310780
protected function prepareOptionLocal()
    {
        $local = $this->defaultLocal;
        foreach ($local as $key => $value) {
            if (!empty($this->local[$key]) && is_string($this->local[$key])) {
                $value = $this->local[$key];
            }
            $local[$key] = Yii::t($this->translateCategory, $value);
        }

        $shortlocal = [];
        $shortNames = [
            'allRecords'        => 'allr',
            'error'             => 'erro',
            'minimumCharacters' => 'mcha',
            'next'              => 'next',
            'noRecords'         => 'nrec',
            'previous'          => 'prev',
            'recordsContaining' => 'rcon',
        ];
        foreach ($local as $key => $value) {
            if (isset($shortNames[$key])) {
                $shortlocal[$shortNames[$key]] = $value;
            } else {
                $shortlocal[$key] = $value;
            }
        }

        return $shortlocal;
    }
3262
public function getLocale() {
		if($this->locale === null)
			$this->locale = $this->getDefinition()->getEntityManager()->getDefaultLocale();
		return $this->locale;
	}
1079314
protected function locale()
    {
        if (($member = Member::currentUser()) && $member->Locale) {
            return $member->Locale;
        }
            
        return i18n::get_locale();
    }
683690
public function isLocal()
    {
        if($this->hasValidResource()) {
            return stream_is_local($this->resource);
        }
        if ($url = $this->url()) {
            return stream_is_local("$url");
        }
        return false;
    }
1161595
public static function disableLocale():bool
    {
        $file = JsonListener::open(FEnv::get("framework.config.core.config.file"));
        if (true === property_exists($file, "locale_enabled") && true === $file->locale_enabled) {
            $file->locale_enabled = false;
            JsonListener::put(
                FEnv::get("framework.config.core.config.file"),
                json_encode($file, JSON_PRETTY_PRINT)
            );
            JsonListener::close(FEnv::get("framework.config.core.config.file"));
            return (true);
        }
        return (false);
    }
1326684
public function saveI18N()
    {
        if (empty($this->i18n_data)) return;
        $this->i18n_relation()->getQuery()->whereIn($this->getI18NCodeField(), array_keys($this->i18n_data))->delete();
        foreach ($this->i18n_data as $locale => $data) {
            $obj                             = new $this->i18n_class();
            $data[$this->i18n_primary]       = $this->id;
            $data[$this->getI18NCodeField()] = $locale;
            $obj->create($data);
        }
    }
741690
public function onBeforeWrite()
    {
        /** @var string $currentLocale */
        $currentLocale = FluentState::singleton()->getLocale();
        if (!$currentLocale) {
            return;
        }

        // If the record is not versioned, force change
        if (!$this->owner->hasExtension(FluentVersionedExtension::class)) {
            $this->owner->forceChange();
            return;
        }

        // Force a change if the record doesn't already exist in the current locale
        if (!$this->owner->existsInLocale($currentLocale)) {
            $this->owner->forceChange();
        }
    }
928603
def enforce_available_locales!(locale)
      if locale != false && config.enforce_available_locales
        raise I18n::InvalidLocale.new(locale) if !locale_available?(locale)
      end
    end
162057
public function locale()
    {
        $accept_language = $this->getHeader('accept_language');

        $tmp = explode(';', $accept_language)[0];

        preg_match('/^([a-z]+(?:-|_)?[a-z]+)/i', $tmp, $match);

        return end($match);
    }
241025
public function getTranslationsLocale()
    {
        $localeIso = $this->locale->getIso();

        if (isset($this->localeTranslationAssociations[$localeIso])) {
            return Locale::create($this->localeTranslationAssociations[$localeIso]);
        }

        return $this->locale;
    }
1227138
function localeIsLoaded(locale) {
  return !!(Cldr._raw && Cldr._raw.main && Cldr._raw.main[getLocaleKey(locale)]);
}
1318780
def save(self, commit=True):
        
        # set the localised fields
        for localized_field in self.instance.localized_fields:
            setattr(self.instance, localized_field, self.cleaned_data[localized_field])

        return super(LocalisedForm, self).save(commit)
950111
public function addLocale(Locale $locale)
    {
        if (isset($this->localeCollection[(string)$locale])) {
            return false;
        }

        // We need to invalidate the parent's array as it could be inaccurate
        $this->localeParentCollection = [];

        $this->localeCollection[(string)$locale] = $locale;
        return true;
    }
307994
public function getLocale(): string
    {
        if (is_null($this->locale)) {
            $this->locale = \Locale::getDefault();
        }

        return $this->locale;
    }
1193497
public function setLocale()
    {
        if ($locale = $this->app->session->get('administrator_locale')) {
            $this->app->setLocale($locale);
        }
    }