Set the translations for a specific locale.

@param Locale $locale
@param Translations $translations
979100
public function setTranslations(Locale $locale, Translations $translations)
    {
        $this->translations[$locale->getID()] = [$locale, $translations];
    }
1047311
public function setLocale($locale)
    {
        if (null !== $locale && !array_key_exists($locale, Application::getAvailableLanguages())) {
            throw new InvalidArgumentException(sprintf('Invalid locale %s.', $locale));
        }

        $this->locale = $locale;

        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;
	}
825598
public function joinTranslations($locale)
    {
        $this->getInstance()
            ->innerJoin($this->mainAlias.'.translations', 'translation', Expr\Join::WITH, 'translation.locale = :locale')
            ->setParameter('locale', $locale);

        return $this;
    }
388471
public function setLocale($locale)
    {
        foreach ($this->datas as $data) {
            $data->getDefinition()->setLocale($locale);
        }
    }
689831
public function setMessages($locale, $messages)
    {
        $this->loadMessagesFromFile($locale);
        $this->addResource('array', $messages, $locale);
        $this->messages[$locale] = array_merge(
            isset($this->messages[$locale]) ? $this->messages[$locale] : [],
            $messages
        );

        return $this;
    }
1249335
protected function setLocale($locale)
    {
        if (is_null($locale) || $locale === 'auto') {
            $locale = app()->getLocale();
        }

        $this->locale = $locale;

        return $this;
    }
1292952
public function setLocales(array $locales) {
        $this->locales = [];
        foreach($locales as $loc)
            $this->addLocale($loc);
    }
1348717
private function translationsNeedsPluralFix(Translations $translations, LocaleEntity $locale, &$translationsPluralCount)
    {
        $txPlurals = $translations->getPluralForms();
        $translationsPluralCount = isset($txPlurals) ? $txPlurals[0] : null;

        return $translationsPluralCount !== $locale->getPluralCount();
    }
606050
public function setLocale($locale)
    {
        if($this->_locale != $locale)
        {
            parent::setLocale($locale);

            //Load the koowa translations
            $this->load('com:koowa');
        }

        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)
        ));
    }
863167
void setLocale(Locale locale)
   {
      m_resourceNames = LocaleData.getStringArray(locale, LocaleData.RESOURCE_NAMES);

      String name;
      m_resourceNumbers.clear();

      for (int loop = 0; loop < m_resourceNames.length; loop++)
      {
         name = m_resourceNames[loop];
         if (name != null)
         {
            m_resourceNumbers.put(name, Integer.valueOf(loop));
         }
      }
   }
141550
public function setLocalise($locale = 'en-GB', LocaliseInterface $localise = null)
    {
        $locale = LanguageNormalize::toLanguageTag($locale);

        $this->localises[$locale] = $localise;

        return $this;
    }
887394
public function setLocale($locale)
    {
        // Handle from locale + country
        switch (strtolower($locale)) {
            // “…”
            case 'pt-br':
                $this->opening = Fixer::LDQUO;
                $this->openingSuffix = '';
                $this->closing = Fixer::RDQUO;
                $this->closingPrefix = '';

                return;
        }

        // Handle from locale only
        $short = Fixer::getLanguageFromLocale($locale);

        switch ($short) {
            // « … »
            case 'fr':
                $this->opening = Fixer::LAQUO;
                $this->openingSuffix = Fixer::NO_BREAK_SPACE;
                $this->closing = Fixer::RAQUO;
                $this->closingPrefix = Fixer::NO_BREAK_SPACE;
                break;
            // «…»
            case 'hy':
            case 'az':
            case 'hz':
            case 'eu':
            case 'be':
            case 'ca':
            case 'el':
            case 'it':
            case 'no':
            case 'fa':
            case 'lv':
            case 'pt':
            case 'ru':
            case 'es':
            case 'uk':
                $this->opening = Fixer::LAQUO;
                $this->openingSuffix = '';
                $this->closing = Fixer::RAQUO;
                $this->closingPrefix = '';
                break;
            // „…“
            case 'de':
            case 'ka':
            case 'cs':
            case 'et':
            case 'is':
            case 'lt':
            case 'mk':
            case 'ro':
            case 'sk':
            case 'sl':
            case 'wen':
                $this->opening = Fixer::BDQUO;
                $this->openingSuffix = '';
                $this->closing = Fixer::LDQUO;
                $this->closingPrefix = '';
                break;
            // “…”
            case 'en':
            case 'us':
            case 'gb':
            case 'af':
            case 'ar':
            case 'eo':
            case 'id':
            case 'ga':
            case 'ko':
            case 'br':
            case 'th':
            case 'tr':
            case 'vi':
                $this->opening = Fixer::LDQUO;
                $this->openingSuffix = '';
                $this->closing = Fixer::RDQUO;
                $this->closingPrefix = '';
                break;
            // ”…”
            case 'fi':
            case 'sv':
            case 'bs':
                $this->opening = Fixer::RDQUO;
                $this->openingSuffix = '';
                $this->closing = Fixer::RDQUO;
                $this->closingPrefix = '';
                break;
        }
    }
612597
public void setLocales(Locale... locales) {

    String[] array = new String[locales.length];
    for (int i = 0; i < locales.length; i++) {
      array[i] = locales[i].toString();
    }
    setLocales(array);
  }
1186383
protected function setLocales(array $locales)
    {
        $this->locales = [];
        foreach ($locales as $langCode => $localeStruct) {
            $this->locales[$langCode] = $this->parseLocale($localeStruct, $langCode);
        }

        return $this;
    }
606754
public static function setLocale($locale)
		{
			static::$_locale = $locale;

			// Apply to PHP locale
			$sysLocales = \ChickenWire\Application::getConfiguration()->systemLocales;
			if (array_key_exists($locale, $sysLocales)) {
				setlocale(LC_ALL, $sysLocales[$locale]);
			}

		}