taoensso.tower

Simple internationalization (i18n) and localization (L10n) library for
Clojure/Script. Wraps standard Java/Script facilities when possible.

*locale*

dynamic

*tscope*

dynamic

all-timezone-ids

config

DEPRECATED.

countries

DEPRECATED.

country-name

(country-name code display-loc)
Experimental.

default-tfmt-str

(default-tfmt-str loc fmt & args)
Implementation detail. Based on `encore/format`.

dev-mode?

DEPRECATED.

dict-compile

Implementation detail.
Compiles text translations stored in simple development-friendly Clojure map
into form required by localized text translator:
  {:en {:example {:foo <tr>}}} => {:example/foo {:en <decorated-tr>}}

dict-compile*

macro

(dict-compile* dict & [opts])
Compile-time compiler.

dict-load

Implementation detail.

dict-load*

macro

(dict-load* dict)
Compile-time loader.

dictionary->xliff

(dictionary->xliff m)

example-tconfig

Example/test config as passed to `make-t`, Ring middleware, etc.

:dictionary should be a map, or named resource containing a map of form
{:locale {:ns1 ... {:nsN {:key<decorator> text ...} ...} ...} ...}}.

Named resource will be watched for changes when `:dev-mode?` is true.

fallback-locale

DEPRECATED.

fmt

(fmt loc x & [style])
Formats Date/Number as a string.
`style` is <:#{date time dt}-#{default short medium long full}>,
e.g. :date-full, :time-short, etc. (default :date-default).

fmt-msg

(fmt-msg loc pattern & args)
Creates a localized MessageFormat and uses it to format given pattern string,
substituting arguments as per MessageFormat spec.

fmt-str

(fmt-str loc fmt & args)
Like clojure.core/format but takes a locale, doesn't throw on nil pattern.

format-currency

(format-currency x)
DEPRECATED.

format-date

(format-date d)(format-date style d)
DEPRECATED.

format-dt

(format-dt dt)(format-dt dstyle tstyle dt)
DEPRECATED.

format-integer

(format-integer x)
DEPRECATED.

format-msg

DEPRECATED.

format-number

(format-number x)
DEPRECATED.

format-percent

(format-percent x)
DEPRECATED.

format-str

DEPRECATED.

format-time

(format-time t)(format-time style t)
DEPRECATED.

get-countries

Experimental. Useful format for [sorted] lists, stitching into maps.

get-langs

Experimental. Useful format for [sorted] lists, stitching into maps.

get-timezones

Experimental. Useful format for [sorted] lists, stitching into maps.

IFmt

protocol

members

pfmt

(pfmt x loc style)

iso-countries

iso-langs

iso-languages

jvm-locale

Returns valid Locale matching given name string/keyword, or throws an
exception if none could be found. `loc` should be of form :en, :en-US,
:en-US-variant, or :jvm-default.

kw-locale

"en_gb-var1" -> :en-gb-var1, etc.

l-compare

(l-compare x y)
DEPRECATED.

lang-name

(lang-name code & [?display-loc])
Experimental.

languages

DEPRECATED.

lcomparator

(lcomparator loc & [style])
Returns localized comparator.

load-dictionary-from-map-resource!

(load-dictionary-from-map-resource!)(load-dictionary-from-map-resource! resource-name & [merge?])
DEPRECATED.

locale

DEPRECATED as of v2.1.0.

lsort

(lsort loc coll & [style])
Localized sort. `style` e/o #{:asc :desc} (default :asc).

major-timezone-ids

make-t

merge-config!

(merge-config! & maps)
DEPRECATED.

normalize

(normalize s & [form])
Transforms Unicode string into W3C-recommended standard de/composition form
allowing easier searching and sorting of strings. Normalization is considered
good hygiene when communicating with a DB or other software.

oldt

parse

(parse loc s & [style])
Parses date/number string as a Date/Number. See `fmt` for possible `style`s
(default :number).

parse-currency

(parse-currency s)
DEPRECATED.

parse-date

(parse-date s)(parse-date style s)
DEPRECATED.

parse-dt

(parse-dt s)(parse-dt dstyle tstyle s)
DEPRECATED.

parse-integer

(parse-integer s)
DEPRECATED.

parse-Locale

(parse-Locale loc)
DEPRECATED: Use `locale` instead.

parse-number

(parse-number s)
DEPRECATED.

parse-percent

(parse-percent s)
DEPRECATED.

parse-time

(parse-time s)(parse-time style s)
DEPRECATED.

scoped

Merges scope keywords: (scope :a.b :c/d :e) => :a.b.c.d/e

set-config!

(set-config! ks val)
DEPRECATED.

sorted-localized-countries

DEPRECATED.

sorted-localized-languages

DEPRECATED.

sorted-timezones

DEPRECATED.

style

(style)(style style)
DEPRECATED.

t

(t loc tconfig k-or-ks & fmt-args)
DEPRECATED. Use `make-t` instead.

timezone

(timezone)(timezone tz-id)

timezones

DEPRECATED.

translate

(translate loc tconfig scope k-or-ks & fmt-args)
DEPRECATED. Use `make-t` instead.

try-jvm-locale

(try-jvm-locale loc & [lang-only?])
Like `jvm-locale` but returns nil if no valid matching Locale could be found.

try-locale

DEPRECATED as of v2.1.0.

tscoped

tz-ids-all

tz-ids-major

with-locale

macro

(with-locale loc & body)
DEPRECATED.

with-scope

macro

(with-scope translation-scope & body)
DEPRECATED.

with-tscope

macro

(with-tscope translation-scope & body)
Executes body with given translation scope binding.

xliff->dictionary

(xliff->dictionary s)