tongue
tongue copied to clipboard
[feature request]: Translation key as vector (similar to how get-in works)
In some scenarios accessing translation by namespaced key overcomplicates things, just vector with path can work.
Consider this scenario:
You want to show a document title
per type.
i18n.clj
...
:documents {:type1 {:title "type1"
:filename "f1"}
:type2 {:title "type2"
:filename "f2"}
:type1 {:title "type3"
:filename "f3"}
(for [t [:type1 :type2 :type3]
(translate :en (keyword (str "documents." (name t)) "filename" )))
This adds keyword manipulation.
Compare with
(for [t [:type1 :type2 :type3]
(translate :en [:documents t :filename])))
This feels way simpler and cleaner.
What do you think?
Yes, looks good. Want to make a PR?
Will try to make one, may take a while tho.