src/mako/validator/Validator.php
protected function getErrorMessage(RuleInterface $rule, string $field, object $parsedRule): string
	{
		$field = $this->getOriginalFieldName($field);

		if($this->i18n !== null && $rule instanceof I18nAwareInterface)
		{
			return $rule->setI18n($this->i18n)->getTranslatedErrorMessage($field, $parsedRule->name, $parsedRule->package);
		}

		return $rule->getErrorMessage($field);
	}
protected function getErrorMessage(RuleInterface $rule, string $field, object $parsedRule): string
	{
		$field = $this->getOriginalFieldName($field);

		if($this->i18n !== null && $rule instanceof I18nAwareInterface)
		{
			return $rule->setI18n($this->i18n)->getTranslatedErrorMessage($field, $parsedRule->name, $parsedRule->package);
		}

		return $rule->getErrorMessage($field);
	}
protected function getErrorMessage ( RuleInterface $ rule , string $ field , object $ parsedRule ) : string { $ field = $ this -> getOriginalFieldName ( $ field ) ; if ( $ this -> i18n !== null && $ rule instanceof I18nAwareInterface ) { return $ rule -> setI18n ( $ this -> i18n ) -> getTranslatedErrorMessage ( $ field , $ parsedRule -> name , $ parsedRule -> package ) ; } return $ rule -> getErrorMessage ( $ field ) ; }
Returns the error message.

@param  \mako\validator\rules\RuleInterface $rule       Rule
@param  string                              $field      Field name
@param  object                              $parsedRule Parsed rule
@return string
Returns the error message .