Tower i18n middleware for Ring.
Tower i18n middleware for Ring.
(wrap-i18n-middleware handler & {:keys [locale-selector-fn]})
DEPRECATED: Use wrap-tower
instead.
DEPRECATED: Use `wrap-tower` instead.
(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:
:en
, :en-US
, etc.[:en-GB :en :en-US :fr-FR :fr]
, etc.:locale
, but a recognized JVM locale.:locales
, but only recognized JVM locales.: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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close