taoensso / tower

i18n & L10n library for Clojure/Script
https://www.taoensso.com/tower
Eclipse Public License 1.0
277 stars 24 forks source link

Allow aliases in dictionaries #24

Closed philipa closed 11 years ago

philipa commented 11 years ago

Peter,

What do you think to aliases in dictionaries:

 {:en  {:example {
    :bar {:baz ":en :example.bar/baz text"}
    :greeting  "Hello {0}, how are you?"
    :yo :example/greeting
    :baz2 :example.bar/baz}

Usage:

(with-locale :en
  (is (= (t :example/yo "Bob") "Hello Bob, how are you?"))
  (is (= (t :example/baz2) (t :example.bar/baz))))

?

Benefits:

If you like this, you might also consider allowing

...
:bar2 :bar}
....
(is (= (t :example.bar2/baz) (t :example.bar/baz)))

- Phil

philipa commented 11 years ago

Damn it. Wrong branch.