Liking cljdoc? Tell your friends :D

systems.bread.alpha.i18n


*read-eagerly*clj/s


compact-fieldsclj/s

(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.
raw docstring

deserializeclj/smultimethod


dirclj/s

(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.
raw docstring

format-fieldsclj/s

(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).
raw docstring

langclj/s

(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.
raw docstring

lang-supported?clj/s

(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.
raw docstring

pluginclj/s

(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-stringsclj/s

(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).
raw docstring

rtl?clj/s

(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.
raw docstring

serializeclj/smultimethod


stringsclj/s

(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).
raw docstring

supported-langsclj/s

(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.
raw docstring

tclj/s

(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.
raw docstring

translatable-binding?clj/s

(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.
raw docstring

with-serializedclj/s

(with-serialized field)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close