1. taka2ru
  2. clj-i18n

Overview

# i18n

Internationalization (i18n) library using java.util.ResourceBundle.

## Usage

(use 'i18n.core)

### Defining Resource (properties)

Write someresource.properties in the classpath:
> hello=Hello, World!
> good_morning=Good morning, World!

For Japanese (or some other languages) resources, write someresource_ja.properties in the classpath:
> hello=こんにちは、世界!
> good_morning=おはよう、世界!

(now you can use UTF-8 stings in properties files without native2ascii!)

### Defining Resource (clojure)

(gen-resource [:someresource nil]
  :hello "Hello, World!"
  :good_morning "Good morning, World!")

(gen-resource [:someresource :ja]
  :hello "こんにちは、世界!"
  :good_morning "おはよう、世界!")

### Getting Resource

(resource :someresource :ja :hello) ; => "こんにちは、世界!"
(resource :someresource nil :good_morning) ; => "Good morning, World!"

### Getting List of Keys

(resource-keys :someresource :ja) ; => (:hello :good_morning)

### Clearing Resource Cache

(use 'resource-bundle.core :reload-all) ;; clear memoized data

## License

Copyright (C) 2011-2012 Tetsuya Takatsuru

Distributed under the Eclipse Public License, the same as Clojure.