Set required encode and binary hash of most probably character in
selected language

@param string $lang [en, fr, gr, it, sp, ar] Language profile selected

@return object $this to build a fluent interface
@author Khaled Al-Sham'aa <khaled@ar-php.org>
544132
public function setLang($lang) 
    {
        switch ($lang) {
        case 'en':
            self::$_encode = ' etaoins';
            break;
        case 'fr':
            self::$_encode = ' enasriu';
            break;
        case 'gr':
            self::$_encode = ' enristu';
            break;
        case 'it':
            self::$_encode = ' eiaorln';
            break;
        case 'sp':
            self::$_encode = ' eaosrin';
            break;
        default:
            self::$_encode = iconv('utf-8', 'cp1256', ' الميوتة');
        }

        self::$_binary = '0000|0001|0010|0011|0100|0101|0110|0111|';
        
        return $this;
    }
1290646
public function setLang($lang_code){
		$lang = $this->dom->metadata->children('dc', true)->language[0];
		$lang[0] = $this->h($lang_code);
		return $lang;
	}
747809
public function set($lang) {
    if (!array_key_exists($lang, $this->getList())) {
      throw new LanguageNotPresentException;
    }
    $this->locator->set($lang);
    return $lang;
  }
724684
public function setLanguage(\Core\Entity\Language $language = null) {
        $this->language = $language;

        return $this;
    }
869256
public static function setLanguage($lang)
    {
        Application::$instance->i18n->setLanguage($lang);
        \Config::set('i18n.language', $lang);
    }
659931
public function validLang($lang)
    {
        if (in_array($lang, $this->validLanguages)) {
            return $lang;
        }
        if ($this->defaultLanguage) {
            return $this->defaultLanguage;
        }
        return false;
    }
138060
public static function setLanguage($language) {
        static::$language = $language;

        static::$message = array();

        $kernalLanguageFolder = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..';
        static::addMessage($kernalLanguageFolder);

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

      return $this;
    }
921091
public function loadDictionary($lang = null)
    {
        if (!is_string($lang) && !is_null($lang)) {
            throw new \InvalidArgumentException("Please provide a string as parameter!");
        } else {
            
            // if nothing is set, get it from the config file
            if (is_null($lang)) {
                $lang = $this->config->value('language');
            }
            
            $file_to_load = $this->language_folder . $lang . '.php';

            return $this->loadFile($file_to_load);
        }
    }
377432
public static function getLocaliseClassPrefix($lang)
    {
        $lang = static::toLanguageTag($lang);

        $lang = str_replace('-', '', $lang);

        return ucfirst($lang);
    }
823002
public function setLang($lang = 'en-us') {
		$this->lang = $lang;

		try {
			$this->messages = parse_ini_file(__DIR__ . '/Lang/' . $this->lang . '.ini');
		} catch (Exception $e) {
			throw $e;
		}
	}
318959
public function lang($language)
    {
        if (empty($language)) {
            $this->resetLang();
        } else {
            $this->lang = $language;
        }

        return $this;
    }
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;
    }
723994
public static function set_current( $lang ) 
	{
		$lang = static::parse( $lang );
		
		if ( !array_key_exists( $lang, static::$data ) ) 
		{
			static::$data[$lang] = array();
		}
		
		return static::$current_language = $lang;
	}
1202064
public function removeLanguage($language)
    {
        $language = (string)$language;
        if (isset($this->entries[$language])) {
            unset($this->entries[$language]);
        }
        return $this;
    }
975371
public static function load(array $langs, $lang = null)
    {
        static::$langs = $langs;
        static::$lang = $lang ?: key($langs);
    }
777649
public function setLanguage(string $lang): void
    {
        if (!is_string($lang) || empty($lang)) {
            throw new \InvalidArgumentException("Invalid language $lang");
        }
        
        $this->lang = $lang;
    }