system/Config/Services.php
public static function language(string $locale = null, bool $getShared = true)
	{
		if ($getShared)
		{
			return static::getSharedInstance('language', $locale)
					   ->setLocale($locale);
		}

		$locale = ! empty($locale)
			? $locale
			: static::request()
				  ->getLocale();

		return new Language($locale);
	}
public static function language(string $locale = null, bool $getShared = true)
	{
		if ($getShared)
		{
			return static::getSharedInstance('language', $locale)
					   ->setLocale($locale);
		}

		$locale = ! empty($locale)
			? $locale
			: static::request()
				  ->getLocale();

		return new Language($locale);
	}
Responsible for loading the language string translations.

@param string  $locale
@param boolean $getShared

@return \CodeIgniter\Language\Language