Skip to main content

BYNK_LOCALE_TYPES_SRC

Constant BYNK_LOCALE_TYPES_SRC 

Source
pub const BYNK_LOCALE_TYPES_SRC: &str = "commons bynk.locale.types {\n\t---\n\tA well-formed BCP-47 language tag: `language[-extlang][-Script][-REGION]\n\t[-variant]*[-extension]*[-privateuse]`, or a standalone `x-...` private-use\n\ttag (e.g. `en`, `pt-BR`, `zh-Hans-CN`, `zh-yue`, `ca-valencia`,\n\t`de-CH-1996`, `en-US-u-ca-buddhist`, `de-CH-x-phonebk`, `x-custom`).\n\tCasing is canonical by construction: language/extlang/variant/extension/\n\tprivate-use lowercase, script Titlecase, region uppercase (or 3 digits).\n\tGrandfathered/irregular tags (`i-klingon`, `en-GB-oed`) don\'t fit this\n\tproductive shape and are rejected. This checks well-formedness only, not\n\tregistry membership \u{2014} `en-abc` (a made-up extlang shape) is well-formed\n\tand accepted, and extlang position isn\'t restricted to a 2-letter primary\n\tthe way RFC 5646 restricts it.\n\t---\n\ttype LocaleTag = String where Matches(\"(?:[a-z]{2,3}(?:-[a-z]{3}){0,3}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|[0-9]{3}))?(?:-(?:[a-z0-9]{5,8}|[0-9][a-z0-9]{3}))*(?:-[a-wy-z0-9](?:-[a-z0-9]{2,8}){1,8})*(?:-x(?:-[a-z0-9]{1,8}){1,8})?|x(?:-[a-z0-9]{1,8}){1,8})\")\n\n\t---\n\tOne value substitutable into a rendered message.\n\t---\n\ttype MessageArg =\n\t\t| Text(value: String)\n\t\t| Whole(value: Int)\n\t\t| Num(value: Float)\n\t\t| Moment(value: Instant)\n\n\t---\n\tA message to render: a lookup code plus its named substitution values.\n\t---\n\ttype Message = {\n\t\tcode: String,\n\t\tparams: Map[String, MessageArg],\n\t}\n}\n";
Expand description

bynk.locale.types — LocaleTag, MessageArg, Message: a dependency-free leaf (no uses of its own) so any consumer, including the bynk adapter itself, can reach these types without also reaching bynk.locale’s value-level API.