/**
 * Allows the application to load a custom or default language.
 *
 * The logic and options for creating this object are adequately generic for default cases
 * but for many applications it will make sense to override this method and create a language,
 * if required, based on more specific needs.
 *
 * @param   Language  $language  An optional language object. If omitted, the factory language is created.
 *
 * @return  WebApplication This method is chainable.
 *
 * @since   1.7.3
 */
public function loadLanguage(Language $language = null)
{
    $this->language = $language ?? Factory::getLanguage();
    return $this;
}