WordPress at a glance
function is not described

PHPMailer\PHPMailer

PHPMailer::lang() protected WP 1.0

Get an error message in the current language.

{} It's a method of the class: PHPMailer{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->lang( $key );
$key(string) (required)
-

Code of PHPMailer::lang() WP 5.7.2

<?php
protected function lang($key)
{
    if (count($this->language) < 1) {
        $this->setLanguage(); //Set the default language
    }

    if (array_key_exists($key, $this->language)) {
        if ('smtp_connect_failed' === $key) {
            //Include a link to troubleshooting docs on SMTP connection failure.
            //This is by far the biggest cause of support questions
            //but it's usually not PHPMailer's fault.
            return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
        }

        return $this->language[$key];
    }

    //Return the key as a fallback
    return $key;
}