translate static method
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 default toString() representation.
Implementation
static String translate(TextXValidationRule rule) =>
_map[rule.runtimeType.toString()] == null
? rule.toString()
: _map[rule.runtimeType.toString()]!(rule);