Keyword-based translations with in-memory caching. Uses qualified keywords for storage like toddler.
Keyword-based translations with in-memory caching. Uses qualified keywords for storage like toddler.
(add-locale locale-mapping)Add translations for a specific locale. Transforms the input to qualified keywords.
{:default {:save "Save"
:cancel "Cancel"}
:hr {:save "Spremi"
:cancel "Odustani"}}
Add translations for a specific locale.
Transforms the input to qualified keywords.
```clojure
{:default {:save "Save"
:cancel "Cancel"}
:hr {:save "Spremi"
:cancel "Odustani"}}
```(add-translations mapping)Add translations to the in-memory cache. Uses Clojure's namespaced map syntax:
#:save {:default "Save"
:hr "Spremi"
:de "Speichern"}
This expands to:
{:save/default "Save"
:save/hr "Spremi"
:save/de "Speichern"}
Add translations to the in-memory cache.
Uses Clojure's namespaced map syntax:
```clojure
#:save {:default "Save"
:hr "Spremi"
:de "Speichern"}
```
This expands to:
```clojure
{:save/default "Save"
:save/hr "Spremi"
:save/de "Speichern"}
```(clear-translations!)Clear all translations from memory
Clear all translations from memory
(load-translations! {:keys [format path locale]})Asynchronously load translations from a URL. Returns a promise.
Options:
Asynchronously load translations from a URL. Returns a promise. Options: - :format - :edn or :json (required) - :path - URL to load from (required) - :locale - If provided, transforms keys to qualified format
(remove-translations key locales)Remove translations for specific key and locales
Remove translations for specific key and locales
Atom containing all loaded translations. Stores qualified keywords only: {:keyword/locale "translation"}
Atom containing all loaded translations.
Stores qualified keywords only:
{:keyword/locale "translation"}cljdoc 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 |