j18n /

Filename Size Date modified Message
gradle
src
45 B
48 B
1.1 KB
1.0 KB
503 B
26 B

j18n – internationalisation for Clojure

j18n is a simple i18n library for Clojure. It uses standard Java resource bundles to do the heavy-lifting and as such integrates well with the Java infrastructure.

Basic Usage

Just call resource with qualified keyword to retrieve a key from the bundle specified by the namespace part of the keyword.

(resource ::my-message)
(resource ::aliased-namespace/my-message)
(resource :some.other.namespace/my-message)

The bundle name is derived from the namespace according to the usual namespace name to file name translation rules.

Or you provide an explicit bundle:

(resource ::my-message (ResourceBundle/getBundle "custom.package"))
(resource :my-message  (ResourceBundle/getBundle "custom.package"))
(resource "my-message" (ResourceBundle/getBundle "custom.package"))

Gradle, lein and other poison

The group and artifact name is “j18n”. So to use with Gradle do:

compile "j18n:j18n:<version>"

With lein/cake:

[j18n <version>]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.