String-based translations using the original text as the key. Extends the Translator protocol for String objects.
String-based translations using the original text as the key. Extends the Translator protocol for String objects.
(add-string-translation english-text locale translated-text)Add a single string translation.
Example:
(add-string-translation "Select date..." :hr "Odaberite datum...")
Add a single string translation. Example: ```clojure (add-string-translation "Select date..." :hr "Odaberite datum...") ```
(add-string-translations translations-map)Add string translations to the cache.
Example usage:
(add-string-translations
{"Select date..." {:hr "Odaberite datum..."
:de "Datum auswählen..."
:fr "Sélectionner une date..."
:es "Seleccionar fecha..."}
"Time:" {:hr "Vrijeme:"
:de "Zeit:"
:fr "Heure:"
:es "Hora:"}})
Add string translations to the cache.
Example usage:
```clojure
(add-string-translations
{"Select date..." {:hr "Odaberite datum..."
:de "Datum auswählen..."
:fr "Sélectionner une date..."
:es "Seleccionar fecha..."}
"Time:" {:hr "Vrijeme:"
:de "Zeit:"
:fr "Heure:"
:es "Hora:"}})
```(clear-string-translations!)Clear all string translations from memory
Clear all string translations from memory
(get-string-translation text locale)Get translation for a string in given locale. Returns original string if no translation found.
Get translation for a string in given locale. Returns original string if no translation found.
(load-datepicker-translations!)Load common datepicker translations into the system
Load common datepicker translations into the system
(load-string-translations! {:keys [format path]})Load string translations from a URL. Expected format: {"English text" {:locale "translation"}}
Options:
Load string translations from a URL.
Expected format: {"English text" {:locale "translation"}}
Options:
- :format - :edn or :json (required)
- :path - URL to load from (required)(remove-string-translation english-text locale)Remove translation for a specific string and locale
Remove translation for a specific string and locale
(remove-string-translations english-text)Remove all translations for a specific string
Remove all translations for a specific string
Atom containing all string translations. Format: {"English text" {:hr "Croatian text" :de "German text" :es "Spanish text"}}
Atom containing all string translations.
Format: {"English text" {:hr "Croatian text"
:de "German text"
:es "Spanish text"}}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 |