September 21, 2016

Tongue

A do-it-yourself i18n library for Clojure and ClojureScriptTongue (by Nikita Prokopov).

From its documentation:

Tongue is very simple yet capable:

  • Dictionaries are just Clojure maps.
  • Translations are either strings, template strings or arbitrary functions.
  • No additional build steps, no runtime resource loading.
  • It comes with no built-in knowledge of world locales. It has all the tooling for you to define locales yourself though.
  • Pure Clojure implementation, no dependencies.
  • Can be used from both Clojure and ClojureScript.

In contrast with other i18n solutions relying on complex and limiting string-based syntax for defining pluralization, wording, special cases etc, Tongue lets you use arbitrary functions. It gives you convenience, code reuse and endless possibilities.

As a result you have a library that handles exaclty your case well with as much detail and precision as you need.


Earlier i18n posts

My earlier i18n related posts Lightweight i18n using DataScript and Lightweight i18n using re-frame are totally obsoleted by the Tongue library and should only be read for their amusement value (and perhaps some DataScript and re-frame background information).

Tags: Software Computer Clojure ClojureScript GUI Functional