Adds the given language to the portal.

@param Localization $localization
163816
public function addLocalization(Localization $localization)
    {
        $this->localizations[] = $localization;

        if ($localization->isDefault()) {
            $this->setDefaultLocalization($localization);
        }

        if ($localization->isXDefault()) {
            $this->setXDefaultLocalization($localization);
        }
    }
1218851
private function addMissing($locale, $transKey)
    {
        if ( ! $this->hasMissing($locale, $transKey)) {
            $this->missing[$locale][] = $transKey;
        }
    }
683336
protected function initLocale($locale)
    {
        $file = $this->localeDir . '/' . $locale . '.php';
        if (file_exists($file)) {
            $data = include $file;

            if (!is_array($data)) {
                $data = [];
            }
        } else {
            $data = [];
        }

        if (!isset($data['pluralForm']) || !is_callable($data['pluralForm'])) {
            $data['pluralForm'] = null;
        }
        if (!isset($data['texts'])) {
            $data['texts'] = [];
        }

        $this->data[$locale] = $data;
    }
681647
public void setLocale(final String locale) {
        if (locale == null && this.locale == null) {
            return;
        } else if (locale == null) {
            removeChild(this.locale);
            this.locale = null;
        } else if (this.locale == null) {
            this.locale = new KeyValueNode<String>(CommonConstants.CS_LOCALE_TITLE, locale);
            appendChild(this.locale, false);
        } else {
            this.locale.setValue(locale);
        }
    }
1190913
public function setLocale($locale)
    {
        /** @var Config $config */
        $config = $this->get('config');
        $config->set('app.locale.selected', $locale);

        /** @noinspection PhpUndefinedMethodInspection */
        $this->get('translator')->setLocale($locale);
    }
972684
public function addDictionary(string $locale, $callbackOrArray): \BearFramework\Localization
    {
        if (!isset($this->dictionaries[$locale])) {
            $this->dictionaries[$locale] = [];
        }
        $this->dictionaries[$locale][] = $callbackOrArray;
        return $this;
    }
518187
public function addMap($locale, $map)
    {
        // Get sanitized locale
        $locale = Locale::sanitizeLocale($locale);

        $this->maps[$locale] = $map;

        return $this;
    }
1070763
public function setLocale($locale)
    {
        if ( ! in_array($locale, self::$supportedLocales)) {
            throw new LocaleNotSupported(sprintf('Locale "%s" is not supported.', $locale));
        }
        $this->locale = $locale;
    }
138023
public function setLocale($locale) {
        $this->locale   = $locale;
        $this->language = substr($locale, 0, (strpos($locale, '-')));
        $this->messages = array();
    }
996538
public void addRequestedLocalization(final Object node, final String key, final String domain, final String locale, final Localization localization) {

		final GenericProperty keyKey    = new GenericProperty("key");
		final GenericProperty domainKey = new GenericProperty("domain");
		final GenericProperty localeKey = new GenericProperty("locale");
		final GenericProperty nodeKey   = new GenericProperty("node");

		boolean notContained = true;
		for (GraphObject gom : localizations) {
			if (notContained) {

				if (gom.getProperty(keyKey).equals(key) && gom.getProperty(domainKey).equals(domain) && gom.getProperty(localeKey).equals(locale)) {

					final GraphObject prevNode = (GraphObject)gom.getProperty(nodeKey);
					if (prevNode != null && node != null && prevNode.getUuid().equals(((GraphObject)node).getUuid())) {
						notContained = false;
					}
				}
			}
		}

		if (notContained) {

			final Map<String, Object> data = new HashMap();
			data.put("node", node);
			data.put("key", key);
			data.put("domain", domain);
			data.put("locale", locale);
			data.put("localization", localization);

			GraphObjectMap converted = GraphObjectMap.fromMap(data);

			if (!localizations.contains(converted)) {
				localizations.add(converted);
			}
		}
	}
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
220709
public function addTranslation(\Sulu\Bundle\ResourceBundle\Entity\OperatorTranslation $translations)
    {
        $this->translations[] = $translations;

        return $this;
    }
885706
private void addToLocaleList(List localeList, List<Locale> locales) {
        if (locales != null) {
            for (Locale locale : locales) {
                if (locale != null && !localeList.contains(locale)) localeList.add(locale);
            }
        }
    }
1310119
public function addTranslation(\Haven\CoreBundle\Entity\CultureTranslation $translations) {
        $this->translations[] = $translations;

        return $this;
    }
714816
public function setLocale($locale)
    {
        $this['config']->set('app.locale', $locale);

        $this['translator']->setLocale($locale);

        $this['events']->dispatch(new Events\LocaleUpdated($locale));
    }
361842
public function setLocale($locale) {
		$this->locale = $locale;
		
		if ($this->checkTranslateObjectIsSet()) {
			$this->translation->setLocale($this->locale);
		}
	}
1292952
public function setLocales(array $locales) {
        $this->locales = [];
        foreach($locales as $loc)
            $this->addLocale($loc);
    }