nationid - v2.2.1
    Preparing search index...

    Function getErrorTemplate

    • Returns the raw template string for kind in locale (no interpolation).

      The returned string still contains the {document} slot for kinds other than "empty". Use getErrorMessage if you want substitution.

      Parameters

      • kind: "empty" | "too_short" | "too_long" | "invalid_format" | "invalid_checksum"

        One of the ParseError["kind"] values.

      • Optionallocale: Locale

        Target locale. Unsupported values fall back to DEFAULT_LOCALE.

      Returns string

      The raw template string, possibly containing {document}.

      import { getErrorTemplate } from "nationid/i18n";

      getErrorTemplate("too_short", "es"); // "El {document} es demasiado corto."
      getErrorTemplate("empty", "en"); // "Please enter a value."