Set the fallback locales (overrides the exists)

@param  array $locales
@param  bool  $preinit
@return Translator
194425
public function setFallbackLocales(array $locales, $preinit = false) {
		$this->resetFallbackLocales();
		$this->addFallbackLocales($locales, $preinit);
		
		return $this;
	}
1186383
protected function setLocales(array $locales)
    {
        $this->locales = [];
        foreach ($locales as $langCode => $localeStruct) {
            $this->locales[$langCode] = $this->parseLocale($localeStruct, $langCode);
        }

        return $this;
    }
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
1127972
public function setRelCanonical($relCanonical, $locale = null)
    {
        $this->translate($locale, false)->setRelCanonical($relCanonical);
        $this->mergeNewTranslations();

        return $this;
    }
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;
    }
1095625
protected function normalizeLocale($key, $locale, $useFallback)
    {
        if (in_array($locale, $this->getTranslatedLocales($key)) || ! $useFallback)
            return $locale;

        return config('app.fallback_locale') ?: $locale;
    }
894828
public function translate($locale = null, $create = false)
    {
        $locale = $locale ?: $this->currentLocale;
        if (null === $locale) {
            throw new \RuntimeException('No locale has been set and current locale is undefined.');
        }

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

        if (!$translation = $this->translations->get($locale)) {
            if ($create) {
                $className = $this->getTranslationClass();

                /** @var TranslationInterface $translation */
                $translation = new $className();
                $translation->setLocale($locale);

                $this->addTranslation($translation);
            } else {
                if (null === $this->fallbackLocale) {
                    throw new \RuntimeException('No fallback locale has been set.');
                }

                if (!$fallbackTranslation = $this->translations->get($this->getFallbackLocale())) {
                    $className = $this->getTranslationClass();

                    /** @var TranslationInterface $translation */
                    $translation = new $className();
                    $translation->setLocale($locale);

                    $this->addTranslation($translation);
                } else {
                    $translation = clone $fallbackTranslation;
                }
            }
        }

        $this->currentTranslation = $translation;
        $this->currentLocale      = $locale;

        return $translation;
    }
438142
public function setFallbackLocales(array $locales)
    {
        // needed as the fallback locales are linked to the already loaded catalogues
        $this->catalogues = [];

        foreach ($locales as $locale) {
            $this->assertValidLocale($locale);
        }

        $this->fallbackLocales = $locales;
    }
681583
private function cloneDefaultLocaleTranslations(array $translationClasses, $targetLocale)
    {
        $this->em->getConnection()->beginTransaction();

        $localeProperty = $this->translatableManager->getTranslationLocaleProperty();

        foreach ($translationClasses as $translationClass) {
            $defaultLocaleTranslations = $this->em->getRepository($translationClass)->findBy([
                $localeProperty => $this->defaultLocale,
            ]);

            foreach ($defaultLocaleTranslations as $translation) {
                $meta = $this->em->getClassMetadata($translationClass);

                $translationClone = clone $translation;
                $ids = $meta->getIdentifier();
                $meta->setIdentifierValues($translationClone, array_fill_keys($ids, null));
                $meta->setFieldValue($translationClone, $localeProperty, $targetLocale);

                foreach ($meta->getAssociationNames() as $property) {
                    if ('translatable' !== $property) {
                        $meta->setFieldValue(
                            $translationClone,
                            $property,
                            $meta->isCollectionValuedAssociation($property) ? new ArrayCollection() : null
                        );
                    }
                }

                $this->em->persist($translationClone);

                $ids = $meta->getIdentifierValues($translation);
                $this->io->comment($translationClass.' '.reset($ids));
            }

            $this->em->flush();
            $this->em->clear();
        }

        $this->em->getConnection()->commit();
    }
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;
    }
569527
public function setLocale($locale = null)
    {
        $locale = self::_prepareLocale($locale);

        if (isset(self::$_localeData[(string) $locale]) === false) {
            $region = substr((string) $locale, 0, 3);
            if (isset($region[2]) === true) {
                if (($region[2] === '_') or ($region[2] === '-')) {
                    $region = substr($region, 0, 2);
                }
            }

            if (isset(self::$_localeData[(string) $region]) === true) {
                $this->_locale = $region;
            } else {
                $this->_locale = 'root';
            }
        } else {
            $this->_locale = $locale;
        }
    }
496217
public function setLocale($locale)
    {
        if ($this->isRoot) {
            $this->translator->setLocale($locale);

            return $this;
        }

        $this->locale = $locale;

        return $this;
    }
1198068
public function setTranslations(array $translations)
    {
        if (gettype($translations) == 'array') {
            $translations = new ArrayCollection($translations);
        }

        $this->translations = $translations;

        return $this;
    }
400003
public function getUnreviewedInitialTranslations(LocaleEntity $locale)
    {
        $rs = $this->app->make(TranslationExporter::class)->getUnreviewedSelectQuery($locale);

        return $this->buildInitialTranslations($locale, $rs);
    }
718288
public function setLocale($locale)
    {
        $this->parentSetLocale($locale);
        $this->formatCache = [];
        $this->dateFormatCache = [];
        return $this;
    }
980536
public function getValidator(array $locales=[]) {
		$validator = $this->getDefinition()->getEntityManager()->createValidator();
		return $this->prepareValidator($validator, $locales);
	}
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]);
				}				
			}
		}