/i18n/context
Dynamic locale scoping and translated message lookup context (t, with-locale) for multilingual applications.
Structs#
Bundle#
structStructured i18n translation bundle with normalized locale catalogs and explicit fallbacks.
| Field | Type | Default | Constraints / Notes |
|---|---|---|---|
default-locale | String | — | — |
locales | Map | — | — |
fallbacks | Map | — | — |
Constants#
Functions & symbols#
Bundle-construct#
Constructs a normalized `Bundle` from `{:en {...} :el {...}}` (plus optional opts) or `{:default-locale "en" :locales {...} :fallbacks {...}}`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
input | Any | required | — |
rest | Any | optional | — |
Anyclear-registered-bundles!#
Clears all entries from the global bundle registry (intended for isolated test suites).
Anycurrent-bundle#
Returns the currently bound translation bundle from dynamic scope (or ()).
Anycurrent-language#
Returns the normalized lowercase base language subtag (e.g. "el-GR" -> "el").
Anycurrent-locale#
Returns the active locale tag from dynamic scope, defaulting to "en".
Anylocalize-field#
Resolves a localized field from a domain entity (`entity:names`, `entity:field` map, `field-<lang>`, or fallback string).
| Parameter | Type | Optional | Description |
|---|---|---|---|
entity | Any | required | — |
field | Any | required | — |
rest | Any | optional | — |
Anyregister-bundle#
Registers a `Bundle` under namespace `ns` (overwriting any existing entry for `ns`) and returns it.
| Parameter | Type | Optional | Description |
|---|---|---|---|
ns | Any | required | — |
bundle | Any | required | — |
Anyregistered-bundle#
Looks up a previously registered `Bundle` by namespace `ns` (returns `()` if unregistered).
| Parameter | Type | Optional | Description |
|---|---|---|---|
ns | Any | required | — |
Anyt#
Translates `key` against registered `:ns/key` bundles or dynamic `*bundle*` and `*locale*`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
key | Any | required | — |
rest | Any | optional | — |
Anyt-html#
Renders a translation message into an `#html`-spliceable fragment Array preserving structured HTML params.
| Parameter | Type | Optional | Description |
|---|---|---|---|
key | Any | required | — |
rest | Any | optional | — |
Anyunregister-bundle#
Removes any registered bundle for namespace `ns`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
ns | Any | required | — |
Anyvalidate-bundle#
Validates locale parity across all keys, plural `:other` fallbacks, and `{var}` placeholders.
| Parameter | Type | Optional | Description |
|---|---|---|---|
bundle | Any | required | — |
Anyvalidate-registered-bundles#
Validates all currently registered bundles with `validate-bundle` and aggregates parity reports.
Any