Set the rules of this Validator.

@param string $lang
@param string $langDir
@return Validator
2175
public function setLanguage($lang = 'en', $langDir = __DIR__ . '/lang/')
    {
        $this->lang    = $lang;
        $this->langDir = $langDir;

        $langFile = realpath($langDir . $lang . '.php');
        if (!file_exists($langFile)) {
            throw new \InvalidArgumentException('No such file: ' . $langDir . $lang . '.php');
        }

        $callable = require $langFile;
        $callable($this);

        return $this;
    }
132925
public function required($input, $key, $lang)
    {
        $lang = $this->custom('required', $lang);
        if (empty($input[$key])) {
            return str_replace(':field', $key, $lang);
        }
    }
1371911
public function setLanguage($language, $category = null)
    {
        if ($category === null) {
            $category = defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL;
        }

        setlocale($category, $language);
        putenv('LANGUAGE='.$language);

        return $this;
    }
749442
public static function isValidDirectory( $dir_lang , $lang )
	{
		if ( ! in_array( $lang , array( "." , ".." ) ) )
		{
			if ( is_dir( $dir_lang . DIRECTORY_SEPARATOR . $lang ) )
			{
				return true;
			}
		}

		return false;
	}
578207
private function setDefaultLocale($lang)
    {
        if ($lang === null) {
            $this->defaultLanguage = $this->languages[0];
            return;
        }

        if (!$this->hasLocale($lang)) {
            if (!is_string($lang)) {
                $lang = is_object($lang) ? get_class($lang) : gettype($lang);
            }

            throw new InvalidArgumentException(sprintf(
                'Unsupported default language; must be one of "%s", received "%s"',
                implode(', ', $this->availableLocales()),
                $lang
            ));
        }

        $this->defaultLanguage = $lang;
    }
1329915
public static void setLanguage(LanguageSelect lang) {
		if (lang == null) GuildWars2.lang = LanguageSelect.English;
		else GuildWars2.lang = lang;
	}
571094
public function set_hyphenator( $lang, Hyphenator $hyphenator ) {
		$this->cache[ $lang ] = $hyphenator;
		$this->changed        = true;
	}
1373196
public function offsetSet($lang, $value)
    {
        if (DataType::isLanguageOrRange($lang)) {
            if (is_null($value)) {
                unset($this->members[$lang]);
            } else {
                $this->members[$lang] = static::checkMember($value);
            }
        } else {
            throw new InvalidArgumentException(
                'JSKOS\LanguageMap may only use language tags or ranges as index'
            );
        }
    }
199450
protected function HLSetLangs($hlId, array $langs)
    {
        $hlId = (int) $hlId;
        if (!$hlId) {
            throw new Exception('Empty Hl id for langs');
        }

        $res = HighloadBlockLangTable::getList([
            'filter' => ['ID' => $hlId],
        ]);
        while ($loc = $res->fetch()) {
            HighloadBlockLangTable::delete($loc['ID']);
        }

        foreach ($langs as $langId => $langValue) {
            $langRes = HighloadBlockLangTable::add([
                'ID' => $hlId,
                'LID' => $langId,
                'NAME' => $langValue,
            ]);
            if (!$langRes->isSuccess()) {
                throw new Exception("Can't create lang {$langId} for {$hlId} highload block: " . implode(', ', $langRes->getErrorMessages()));
            }
        }
    }
444495
public function setMsgs( $messagesByKey, $domain = null, $lang = null ) {
		foreach ( $messagesByKey as $key => $message ) {
			$this->setMsg( $key, $message, $domain, $lang );
		}
	}
292396
public function set($lang) {
		if ($this->isValid($lang)) {
			$this->_language = $lang;
			$this->_l10n = $this->getL10n();

			// switch the locales
			$this->setLocale($this->_l10n['keys']);

			// clear content because language has changed
			$this->_content = null;
			return true;
		}
		return false;
	}
1349662
public function setLocale($lang, $territory = null)
    {
        $lang = strtolower($lang);

        $this->setObject(
            'locale',
            (isset($territory) ? $lang . '_' . strtoupper($territory) : $lang)
        );

        return $this;
    }
1271784
protected function custom($key, $lang)
    {
        return ($this->_replaceWithCustom[$key]) ? $this->_custom[$key] : $lang;
    }
1104960
private function validateLabels( $taxonomy, $target, $lang = 'en' )
	{
		$labelArcs = $taxonomy->getGenericArc( XBRL_Constants::$genericElementLabel, $target->extendedLinkRoleUri, $target->label, $target->path, null, $target->linkbase );
		if ( ! $labelArcs ) return true;

		// Find the filter resources
		foreach ( $labelArcs as $labelArc )
		{
			if ( $labelArc['path'] != $target->path ) continue;

			// TODO Handle preferred label by taking and using the preferred label role from the arc
			$result = $taxonomy->getGenericLabel( XBRL_Constants::$genericRoleLabel, $labelArc['to'], substr( $lang, 0, 2 ), $target->path );

			if ( ! $result ) continue;

			// The should be only one but make sure by taking the first.
			$textLabel = reset( $result );
			$target->description = $textLabel['text'];
		}

		return true;
	}
371182
public void setLang(java.lang.String lang) {
        getStateHelper().put(PropertyKeys.lang, lang);
        handleAttribute("lang", lang);
    }
1315556
protected function setRootDir(/*# string */ $rootDir)
    {
        // validate root directory
        if (!is_string($rootDir) || !is_dir($rootDir) || !is_readable($rootDir))
        {
            throw new InvalidArgumentException(
                Message::get(Message::CONFIG_DIR_INVALID, $rootDir),
                Message::CONFIG_DIR_INVALID
            );
        }
        $this->root_dir = rtrim($rootDir, '/\\');

        return $this;
    }
567147
public function setLanguage($language)
    {
        $allowedValues = $this->getLanguageAllowableValues();
        if (!is_null($language) && !in_array($language, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'language', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['language'] = $language;

        return $this;
    }