(compact-fields fields)Takes a sequence of translatable fields and compacts it down to a single map, using :field/key and :field/content as the map keys and values, respectively.
Takes a sequence of translatable fields and compacts it down to a single map, using :field/key and :field/content as the map keys and values, respectively.
(dir req)Whether the lang for the current request is written right-to-left according to :i18n/rtl-langs config.
Whether the lang for the current request is written right-to-left according to :i18n/rtl-langs config.
(format-fields context fields)Formats each field's :field/content according to :field/format (by calling deserialize).
Formats each field's :field/content according to :field/format (by calling deserialize).
(lang {:as req :keys [headers]})High-level fn for getting the language for the current request.
High-level fn for getting the language for the current request.
(lang-supported? app lang)Whether lang has any translatable strings available. Does not necessarily indicate that all translatable strings have translations for lang.
Whether lang has any translatable strings available. Does not necessarily indicate that all translatable strings have translations for lang.
(plugin)(plugin {:keys [lang-param fallback-lang supported-langs global-strings
query-global-strings? query-lang? format-fields? compact-fields?
rtl-langs lang-names home-route]
:or {query-lang? true
compact-fields? true
format-fields? true
rtl-langs #{:arc :ug :sy :ur :ku :yi :brh :ar :dv :sd :he :ps :fa}
lang-names {:ar "عربي" :en "English" :es "Español" :fr "Français"}
global-strings {}
home-route :field/lang
query-global-strings? true
lang-param :field/lang
fallback-lang :en
supported-langs #{:en}}})(read-strings path)Read strings from the filesystem. If read-eagerly is true (the default), returns a plain i18n map, keyed by lang/locale; if false, returns an ILookup instance that dynamically reads from the filesystem on each call to (get).
Read strings from the filesystem. If *read-eagerly* is true (the default), returns a plain i18n map, keyed by lang/locale; if false, returns an ILookup instance that dynamically reads from the filesystem on each call to (get).
(rtl? req)Whether the lang for the current request is written right-to-left according to :i18n/rtl-langs config.
Whether the lang for the current request is written right-to-left according to :i18n/rtl-langs config.
(strings req)(strings req lang)Load the strings from the database for the current language, i.e. (lang req).
Load the strings from the database for the current language, i.e. (lang req).
(supported-langs req)Checks all supported languages in the database. Returns supported langs as a set of keywords.
Checks all supported languages in the database. Returns supported langs as a set of keywords.
(t i18n k)Translates k into its value in the given i18n map. If k is a sequence, treats (first k) as i18n key and (rest k) as args to format.
Translates k into its value in the given i18n map. If k is a sequence, treats (first k) as i18n key and (rest k) as args to format.
(translatable-binding? qb)Takes a query binding vector and returns the binding itself if it is translatable, otherwise nil.
Takes a query binding vector and returns the binding itself if it is translatable, otherwise nil.
(with-serialized field)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 |