setLanguage class method

Sets the order language

@access        public
@param        $language - string
@return        boolean
769714
public function setLanguage($language = 'ro')
    {
        $language = trim(strtolower($language));
        switch ($language) {
            case 'ro':
                $this->language = 'ro';
                break;
            case 'en':
            default:
                $this->language = 'en';
        }

        return true;
    }
1271010
public function setLanguage($language)
    {
        if (!Icepay_Parameter_Validation::language($language))
            throw new Exception('Please enter a valid language (ISO 639-1)', 1006);

        $this->language = $language;
        return $this;
    }
462639
public function set_hyphenation_language( $lang = 'en-US' ) {
		if ( isset( $this->data['hyphenLanguage'] ) && $this->data['hyphenLanguage'] === $lang ) {
			return; // Bail out, no need to do anything.
		}

		$this->data['hyphenLanguage'] = $lang;
	}
226861
public function setLanguage($lang)
    {
        $this->clearCachedValueIf($this->lang != $lang);
        $this->lang = $lang;
    }
1107811
public function set_language( $lang = 'en-US' ) {
		if ( isset( $this->language ) && $this->language === $lang ) {
			return true; // Bail out, no need to do anything.
		}

		$success            = false;
		$language_file_name = \dirname( __FILE__ ) . '/lang/' . $lang . '.json';

		if ( \file_exists( $language_file_name ) ) {
			$raw_language_file = \file_get_contents( $language_file_name );

			if ( false !== $raw_language_file ) {
				$language_file = \json_decode( $raw_language_file, true );

				if ( false !== $language_file ) {
					$this->language           = $lang;
					$this->pattern_trie       = Trie_Node::build_trie( $language_file['patterns'] );
					$this->pattern_exceptions = $language_file['exceptions'];

					$success = true;
				}
			}
		}

		// Clean up.
		if ( ! $success ) {
			$this->language           = null;
			$this->pattern_trie       = null;
			$this->pattern_exceptions = [];
		}

		// Make sure hyphenationExceptions is not set to force remerging of patgen and custom exceptions.
		$this->merged_exception_patterns = null;

		return $success;
	}
1204607
public static function set($language = null)
    {
        self::$messages = array();
        $language = $language ?: self::$config['language'];
        $filename = Atomik::findFile("$language.php", Atomik::path(self::$config['dir']));
        if ($filename === false) {
            throw new AtomikException("Language '$language' does not exists");
        }
        
        $messages = include $filename;
        if (is_array($messages)) {
            self::$messages = array_merge(self::$messages, $messages);
        }
        
        Atomik::set('app.language', $language);
        self::$config['language'] = $language;
        if (isset($_SESSION)) {
            $_SESSION['__LANG'] = $language;
        }
    }
1272965
function setLanguage () {
		if (!defined('LANGUAGES')){
			define('LANGUAGES', 'en');
		}	
		$this->i18nURL();
		if (!defined('LANG')){
			if (!$this->lang){
				$this->lang = 'en';
			}
			define('LANG', $this->lang);
		}
	}
869256
public static function setLanguage($lang)
    {
        Application::$instance->i18n->setLanguage($lang);
        \Config::set('i18n.language', $lang);
    }
1184421
public function setLanguage(Language $language)
    {
        $this->language = $language;
        $this->languageId = $language->getLanguageId();
    }
1133299
public function setLanguage($language) {
        if (!session_id()) {
            if ($this->sessionManager) {
                $this->sessionManager->start();
            }
        }
		$_SESSION['_fine_I18n_language'] = $language;
	}
661621
public function setLanguageDatabase(string $language) : bool
    {
        $pdo = $this->bot->getPDO();

        // Update the language in the database
        $sth = $pdo->prepare('UPDATE ' . $this->user_table . ' SET language = :language WHERE '
                                             . $this->id_column . ' = :id');
        $sth->bindParam(':language', $language);

        $chat_id = $this->bot->chat_id;
        $sth->bindParam(':id', $chat_id);

        try {
            $sth->execute();
        } catch (\PDOException $e) {
            throw new BotException($e->getMessage());
        }

        $this->language = $language;

        return true;
    }
1296010
public function setLanguage($language, $force_reset = false)
    {
        if ($force_reset) {
            $this->loaded_language = false;
        }

        // Clean up the language name to prevent malicious code injection
        $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);

        $language = strtolower($language);

        // Retrieve the full filename
        $file_name = self::LANG_ROOT . $language . '.php';
        if ($file_name == $this->loaded_language) {
            // this language is already loaded!
            return;
        }

        $this->language = $language;

        $this->error = false;
        $this->strict_mode = self::NEVER;

        //Check if we can read the desired file
        if (!is_readable($file_name)) {
            $this->error = self::ERROR_NO_SUCH_LANG;

            return;
        }

        // Load the language for parsing
        $this->load_language($file_name);
    }
202847
public function addDetectedLanguage($language)
    {
        if (!in_array($language, $this->detectedLanguages)) {
            $this->detectedLanguages[] = $language;
        }

        return $this;
    }
361594
public function updateLanguage(Language $language)
    {
        try {
            return $this->innerGateway->updateLanguage($language);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
839234
def set_language(self, language):
        
        if isinstance(language, str):
            language_obj = languages.getlang(language)
            if language_obj:
                self.language = language_obj.code
            else:
                raise TypeError("Language code {} not found".format(language))
        if isinstance(language, languages.Language):
            self.language = language.code
271372
public function setLanguage($language)
	{
        if (! $this->exists($language)) {
            $language = $this->_default;
        }

        $this->_language = $language;
        $this->_meta = $this->getMetadata($this->_language);
        $local = $this->getLocale();
        setlocale(LC_TIME, $local);

		return $this;
	}
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);
	}