framework/data/DataFilter.php
public function setErrorMessages($errorMessages)
    {
        if (is_array($errorMessages)) {
            $errorMessages = array_merge($this->defaultErrorMessages(), $errorMessages);
        }
        $this->_errorMessages = $errorMessages;
    }
public function setErrorMessages($errorMessages)
    {
        if (is_array($errorMessages)) {
            $errorMessages = array_merge($this->defaultErrorMessages(), $errorMessages);
        }
        $this->_errorMessages = $errorMessages;
    }
Sets the list of error messages responding to invalid filter structure, in format: `[errorKey => message]`.
Message may contain placeholders that will be populated depending on the message context.
For each message a `{filter}` placeholder is available referring to the label for [[filterAttributeName]] attribute.
@param array|\Closure $errorMessages error messages in `[errorKey => message]` format, or a PHP callback returning them.