Sets a default language for a user record.

@param string $lang
481423
public function setUserDefaultLanguage($lang)
    {
        $app = Application::getFacadeApplication();
        $db = $app['database']->connection();
        $session = $app['session'];

        $this->uDefaultLanguage = $lang;
        $session->set('uDefaultLanguage', $lang);
        $db->Execute('update Users set uDefaultLanguage = ? where uID = ?', array($lang, $this->getUserID()));
    }
371182
public void setLang(java.lang.String lang) {
        getStateHelper().put(PropertyKeys.lang, lang);
        handleAttribute("lang", lang);
    }
846877
public function setLang($request)
    {
        if (Auth::check()) {
            $user = Auth::user();

            // Set user locale
            if ($user->locale) {
                $this->setIfAllowed($user->locale);
            } else {
                if (config('localizer.set_auto_lang')) {
                    $this->setIfAllowed(Identify::lang()->getLanguage());
                } else {
                    $this->setIfAllowed(config('localizer.default_lang'));
                }
            }
        } else {
            if ($request->session()->has('locale')) {
                $this->setIfAllowed(session('locale'));
            } else {
                if (config('localizer.set_auto_lang')) {
                    $this->setIfAllowed(Identify::lang()->getLanguage());
                } else {
                    $this->setIfAllowed(config('localizer.default_lang'));
                }
            }
        }
    }
966512
public function setLanguage($lang): bool
    {
        if (Arr::in($lang, App::$Properties->get('languages'))) {
            $this->language = $lang;
            return true;
        }

        return false;
    }
1319157
public function setDefaultLocale($locale)
    {
        $this->defaultLocale = $locale;

        if (null === $this->locale) {
            $this->setPhpDefaultLocale($locale);
        }
    }
914705
public function setLang($lang)
    {
        if (2 !== strlen($lang)) {
            throw new \InvalidArgumentException('Language identifier should be 2 characters long.');
        }

        if (!in_array($lang, $this->getSupportedLanguages())) {
            throw new \InvalidArgumentException(sprintf('Language "%s" is not supported.', $lang));
        }

        $this->lang = $lang;

        return $this;
    }
1260106
public function setLanguage($lang)
    {
      if (isset($this->commonUploadErrors[$lang])) {
        $this->language = $lang;
      } else {
        $this->error = $this->commonUploadErrors[$this->language]['ERROR_09'];
      }

      return $this;
    }
10141
public function setLang(\Core\Entity\Language $lang = null)
    {
        $this->lang = $lang;

        return $this;
    }
53205
public function setLang( $lang ) {
		if ( !IntuitionUtil::nonEmptyStr( $lang ) ) {
			return false;
		}
		$this->currentLanguage = $this->normalizeLang( $lang );
		return true;
	}
919751
public static function setLanguage($language)
    {
        if (! ($language instanceof Language)) {
            $language = Language::findByCode($language);
        }

        if (! $language) {
            return false;
        }

        App::setLocale($language->code);
        request()->setDefaultLocale($language->code);
        self::$language = $language;

        return $language;
    }
637202
public function setTranslationsForLanguage(array $messages, $language) {
		$messageFile = $this->getMessageFile($language);
		$messageFile->setMessages($messages);
		$messageFile->save();

		$this->messages[$language] = array_merge($this->messages[$language], $messages);
	}
1165660
public static function initialiseLang()
        {
            $lang = !empty($_REQUEST['lang']) ? preg_replace('/[^a-zA-Z\-]/', null, $_REQUEST['lang']) : 'en';
            Lang::initialize();
            Lang::set($lang, false);
        }
1130804
public static function setLanguage($language)
    {
        // regex source: http://www.w3.org/TR/xmlschema11-2/#language
        if (preg_match('/[a-z]{1,8}(-[a-z0-9]{1,8})*/i', $language) === 1) {
            self::$language = $language;
        } else {
            trigger_error('Invalid language tag: ' . $language, E_USER_WARNING);
        }
    }
1272965
function setLanguage () {
		if (!defined('LANGUAGES')){
			define('LANGUAGES', 'en');
		}	
		$this->i18nURL();
		if (!defined('LANG')){
			if (!$this->lang){
				$this->lang = 'en';
			}
			define('LANG', $this->lang);
		}
	}
133205
public function setTranslationsForLanguage(array $messages, $language)
    {
        foreach ($messages as $key => $value) {
            $this->setTranslation($key, $value, $language);
        }
    }
275779
public function setLanguage($language)
    {
        $this->setLocale($language);

        $code = $this->getLanguageCode($language);

        putenv('LC_ALL=' . $code);
        setlocale(LC_ALL, $code);
        setlocale(LC_NUMERIC, 'en_US');

        return $this;
    }
464114
public static function set($lang = NULL) {
        $languages = get_config('langs');
        if (!$languages) {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_LANG_CONFIG);
        }

        if (!get_config('lang_default')) {
            throw new \Exception(ExceptionMessages::MISCONFIGURED_LANG_DEFAULT_CONFIG);
        }

        if (empty($lang) || !in_array($lang, $languages)) {
            $lang = get_config('lang_default');
        }

        self::$currentLang = $lang;
        self::load($lang);
    }