Pure translation functions for the i18n module.
FC/IS rule: PURE functions only — no I/O, no logging, no exceptions.
Translation key resolution order (locale chain):
Marker syntax: [:t :key] — simple lookup [:t :key {:param val}] — with interpolation params [:t :key {:n 3} 3] — plural form (count as 4th arg)
Pure translation functions for the i18n module.
FC/IS rule: PURE functions only — no I/O, no logging, no exceptions.
Translation key resolution order (locale chain):
1. User locale (e.g. :nl)
2. Tenant locale (e.g. :nl)
3. Default locale (:en)
4. Fallback: (str key) for graceful degradation
Marker syntax:
[:t :key] — simple lookup
[:t :key {:param val}] — with interpolation params
[:t :key {:n 3} 3] — plural form (count as 4th arg)(t catalogue locale-chain key)(t catalogue locale-chain key params)(t catalogue locale-chain key params n)Translate a key using a locale chain and optional catalogue.
Args: catalogue - map of {locale {key string-or-plural-map}} or ICatalogue locale-chain - ordered vector of locale keywords to try, e.g. [:nl :en] key - keyword translation key, e.g. :user/sign-in params - (optional) map of interpolation params, e.g. {:name "Alice"} n - (optional) count for plural selection
Returns: Translated and interpolated string, or (str key) on missing entry
Translate a key using a locale chain and optional catalogue.
Args:
catalogue - map of {locale {key string-or-plural-map}} or ICatalogue
locale-chain - ordered vector of locale keywords to try, e.g. [:nl :en]
key - keyword translation key, e.g. :user/sign-in
params - (optional) map of interpolation params, e.g. {:name "Alice"}
n - (optional) count for plural selection
Returns:
Translated and interpolated string, or (str key) on missing entrycljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |