Twig/Extension.php
public function msgIfExists(string $message = '', array $vars = [])
    {
        $exists = $this->msgExists($message, $vars);
        if ($exists) {
            return $this->msg($message, $vars);
        }
        return $message;
    }
public function msgIfExists(string $message = '', array $vars = [])
    {
        $exists = $this->msgExists($message, $vars);
        if ($exists) {
            return $this->msg($message, $vars);
        }
        return $message;
    }
public function msgIfExists ( string $ message = '' , array $ vars = [ ] ) { $ exists = $ this -> msgExists ( $ message , $ vars ) ; if ( $ exists ) { return $ this -> msg ( $ message , $ vars ) ; } return $ message ; }
Get an i18n message if the key exists, otherwise treat as plain text.
@param string $message
@param string[] $vars
@return mixed|null|string
Get an i18n message if the key exists otherwise treat as plain text .