Liking cljdoc? Tell your friends :D

systems.bread.alpha.i18n


*read-eagerly*clj/s

source

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.
sourceraw docstring

deserializeclj/smultimethod

source

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.
sourceraw 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).
sourceraw 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.
sourceraw 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.
sourceraw 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}}})
source

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).
sourceraw 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.
sourceraw docstring

serializeclj/smultimethod

source

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).
sourceraw 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.
sourceraw 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.
sourceraw 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.
sourceraw docstring

with-serializedclj/s

(with-serialized field)
source

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