Liking cljdoc? Tell your friends :D

taoensso.tower.ring

Tower i18n middleware for Ring.

Tower i18n middleware for Ring.
raw docstring

with-localecljmacro

(with-locale loc & body)
source

wrap-i18n-middlewareclj

(wrap-i18n-middleware handler & {:keys [locale-selector-fn]})

DEPRECATED: Use wrap-tower instead.

DEPRECATED: Use `wrap-tower` instead.
sourceraw docstring

wrap-towerclj

(wrap-tower handler
            tconfig
            &
            [{:keys [locale-selector fallback-locale langs-only?
                     t'-nsorted-locales]
              :or {fallback-locale :jvm-default}
              :as opts}])

Determines locale preference for request by attempting to parse a valid locale from Ring request. (fn locale-selector [ring-request]) can be used to select locale(s) by IP address, subdomain, TLD, etc.

Adds keys to Ring request:

  • :locale - Preferred locale: :en, :en-US, etc.
  • :locales - Desc-preference locales: [:en-GB :en :en-US :fr-FR :fr], etc.
  • :jvm-locale - As :locale, but a recognized JVM locale.
  • :jvm-locales - As :locales, but only recognized JVM locales.
  • :tconfig - tconfig map as given.
  • :t - (fn [locale-or-locales k-or-ks & fmt-args]).
  • :t' - (fn [k-or-ks & fmt-args]), using :locales as above.
Determines locale preference for request by attempting to parse a valid
locale from Ring request. `(fn locale-selector [ring-request])` can be used to
select locale(s) by IP address, subdomain, TLD, etc.

Adds keys to Ring request:
  * :locale      - Preferred locale: `:en`, `:en-US`, etc.
  * :locales     - Desc-preference locales: `[:en-GB :en :en-US :fr-FR :fr]`, etc.
  * :jvm-locale  - As `:locale`, but a recognized JVM locale.
  * :jvm-locales - As `:locales`, but only recognized JVM locales.
  * :tconfig     - tconfig map as given.
  * :t           - (fn [locale-or-locales k-or-ks & fmt-args]).
  * :t'          - (fn [k-or-ks & fmt-args]), using `:locales` as above.
sourceraw docstring

wrap-tower-middlewareclj

(wrap-tower-middleware handler
                       &
                       [{:as opts
                         :keys [locale-selector fallback-locale tconfig]
                         :or {fallback-locale :jvm-default
                              tconfig tower/example-tconfig}}])

DEPRECATED. Use wrap-tower instead.

DEPRECATED. Use `wrap-tower` instead.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close