Returns the string

@param string $lang The langauge to use when processing the string
@return string
168409
public function out($lang = null) {
        if ($lang !== null && $lang != $this->lang && ($this->lang == null && $lang != current_language())) {
            if ($this->forcedstring) {
                debugging('lang_string objects that have been used cannot be printed in another language. ('.$this->lang.' used)', DEBUG_DEVELOPER);
                return $this->get_string();
            }
            $translatedstring = new lang_string($this->identifier, $this->component, $this->a, $lang);
            return $translatedstring->out();
        }
        return $this->get_string();
    }
210476
public function getSuggestions($lang = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('users', 'suggestions');

		// Set the API path
		$path = '/users/suggestions.json';

		$data = array();

		// Check if entities is true
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}
156331
private function getLanguage(string $language): string
    {
        $language = trim($language);

        if (strlen($language) === 2) {
            $language = "{$language}-{$language}";
        }

        if (!preg_match("/^[a-z]{2}-[a-z]{2}$/i", $language)) {
            throw new InvalidArgumentException("Unexpected language code ({$language}), codes should be 2 characters, a hyphen, and a further 2 characters");
        }

        list($main, $sub) = explode("-", $language);
        $language = strtolower($main) . "-" . strtoupper($sub);

        return $language;
    }
731562
public function getLanguage(string $lang): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('GET', $this->createUri("/api/2/language/$lang/")));
    }
1344675
private function extractDataOfLanguage($lang)
    {
        $found = [];
        // parsing language preference instructions
        // 2_digit_code[-longer_code][;q=coefficient]
        preg_match('/([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\.]+))?/', $lang, $found);
        // 2 digit lang code
        $code = isset($found[1]) ? $found[1] : null;
        // lang code complement
        $morecode = isset($found[3]) ? $found[3] : null;
        // full lang code
        $fullcode = $morecode ? $code.'-'.$morecode : $code;
        // coefficient
        $coef = sprintf('%3.1f', isset($found[5]) ? $found[5] : '1');
        // for sorting by coefficient
        // adding
        return array('code' => $code,'coef' => $coef,'morecode' => $morecode,'fullcode' => $fullcode);
    }
103511
public static String resolve( String lang ) {

		String result;
		if( ! LANGUAGES.contains( lang ))
			result = EN;
		else
			result = lang;

		return result;
	}
477637
public function getLanguage( $language )
	{
		$pattern		= '/^([a-z]{1,8}(?:-[a-z]{1,8})*)(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?$/i';
		if( !$language )
			return $this->default;
		$accepted	= preg_split( '/,\s*/', $language );
		$curr_lang	= $this->default;
		$curr_qual	= 0;
		foreach( $accepted as $accept)
		{
			if( !preg_match ( $pattern, $accept, $matches) )
				continue;
			$lang_code = explode ( '-', $matches[1] );
			$lang_quality =  isset( $matches[2] ) ? (float)$matches[2] : 1.0;
			while (count ($lang_code))
			{
				if( in_array( strtolower( join( '-', $lang_code ) ), $this->allowed ) )
				{
					if( $lang_quality > $curr_qual )
					{
						$curr_lang	= strtolower( join( '-', $lang_code ) );
						$curr_qual	= $lang_quality;
						break;
					}
				}
				array_pop ($lang_code);
			}
		}
		return $curr_lang;
	}
974018
public function getPlaceholder($lang = null)
    {
        $lang = empty($lang) ? $this->getDefaultLanguage() : $lang;

        if (!isset($this->placeholders[$lang])) {
            return $this->getFirstPlaceholder();
        }

        return $this->placeholders[$lang];
    }
655217
public static function get($encoding) {
        if (isset(self::$aliases[strtolower($encoding)])) {
            return self::$aliases[strtolower($encoding)];
        } else {
            return $encoding;
        }
    }
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);
        }
    }
982031
public function getKeyword($keyword, $lang = null)
    {
        $parts = $this->_callInternalLocale('getKeywords', null, $lang, false);
        return isset($parts[$keyword]) ? $parts[$keyword] : null;
    }
1230367
public function getAll($lang = "")
    {
        $classNameArr = explode("\\", get_class($this));
        $className = "App\\Models\\".str_replace("Controller", "", $classNameArr[4]);
        $rowsPerPage = $className::$rowsPerPage;
        $class = new $className();

        $obj = DB::table($class->table);
        if(isset($_GET['order']) && isset($_GET['type'])) {
            $obj = $obj->orderBy($_GET['order'], $_GET['type']);
        }
        return $obj->simplePaginate($rowsPerPage);
    }
261566
public static function get_component_strings($component, $lang = null) {

        if (empty($lang)) {
            $lang = current_language();
        }

        $params = self::validate_parameters(self::get_component_strings_parameters(),
                      array('component'=>$component, 'lang' => $lang));

        $stringmanager = get_string_manager();

        $wsstrings = array();
        $componentstrings = $stringmanager->load_component_strings($params['component'], $params['lang']);
        foreach($componentstrings as $stringid => $string) {
            $wsstring = array();
            $wsstring['stringid'] = $stringid;
            $wsstring['string'] = $string;
            $wsstrings[] = $wsstring;
        }

        return $wsstrings;
    }
1273167
public function get($language)
    {
        $result = array();
        if (isset($this->{$language})) {
            $result = $this->{$language};
        }
        if ($language !== 'nl' && isset($this->nl)) {
            $result += $this->nl;
        }
        return $result;
    }
116731
public static function lang($name, $vars = [], $lang = '')
    {
        if (function_exists('lang')) {
            return lang($name, $vars, $lang);
        }

        return $name;
    }
60536
public function getAvailableLanguagesNames($lang = null)
    {
        if (!is_null($lang)) {
            $original_lang = $this->getLanguage();
            $this->setLanguage($lang);
        }
        $db = $this->getLoader()->getOption('available_languages');
        $full_locales = array();
        if (!empty($db)) {
            foreach ($db as $ln=>$locale) {
                $full_locales[$ln] = Locale::getDisplayName($locale);
            }
        }
        if (!empty($original_lang)) {
            $this->setLanguage($original_lang);
        }
        return $full_locales;
    }
568181
public function get($key) 
    {
        return isset($this->langs[$key]) ? $this->langs[$key] : $key;
    }