translate static method

String translate(
  1. TextXValidationRule rule
)

Translates a TextXValidationRule into a localized error message using the registered translation function. If no translation function is registered for a specific rule type, it falls back to the rule's defaultMessage.

Implementation

static String translate(TextXValidationRule rule) =>
    _map[rule.runtimeType.toString()] == null
    ? rule.defaultMessage
    : _map[rule.runtimeType.toString()]!(rule);