Hi Scott,
Happy to hear you're enjoying the library!
1. It seems useful to have the possibility for multiple
> libraries/namespaces to manage their own i18n complete with unique
> configurations (tower/config). I'm not in this situation right now but it
> seems like it could come up.
>
- Is there a better way that hasn't jumped out at me?
>
Could you give me a better idea what kind of unique config you'd expect to
want? The dictionary keys are arbitrarily nest-able, so that's quite easy
to namespace as {:dictionary {:dic1 {...} :dict2 {...}}}, etc. Are you
concerned about the default locale?
2. It also seems like a godd idea to be able to have code merge in a chunk
> of translations into the existing translation dictionary without replacing
> the existing contents.
>
- If it's not there, is the merge idea valid and does it sound useful?
>
If I've understood you correctly, you can already merge into the config
atom without any trouble. Use something like this:
(defn deep-merge-with
[f & maps]
(apply
(fn m [& maps]
(if (every? map? maps)
(apply merge-with m maps)
(apply f maps)))
maps))
(def deep-merge (partial deep-merge-with (fn [x y] y)))
I've just added a `merge-config!` fn to the dev branch to make this easier.
> I've also not been using :dev mode since that can replace the dictionary
> with only the primary and I loose all plugins' dictionaries.
>
I hadn't though of that. I'll tweak it now so that the dictionary gets
merged in as you suggest, nice idea - thank you.
(I'd image it would also change :dev mode to allow a collection of
> "watched" dictionary resources and merge them when they change or something
> like that)
>
Not sure why we'd want/need multiple dictionaries though when you can just
namespace within the one. Can you describe a use-case?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en