It's very simple: Leave configuration file management and stuff out of the 
lib. Instead, pass the translations dictionary to your library as an 
argument.

On your app level, you could still load the desired dictionary from a 
config file but the lib should stay independent of this.


On Wednesday, April 20, 2016 at 6:09:12 AM UTC+2, Shantanu Kumar wrote:
>
> How about accepting a fn as argument to provide the config required? In 
> that case the user is free to use whichever library/hand-rolled code to 
> read config from a file.
>
> Shantanu
>
> On Tuesday, 19 April 2016 22:15:22 UTC+5:30, Facundo Olano wrote:
>>
>> Hi! I started to use clojure a couple of months ago and now I'm 
>> struggling to extract a little library from a larger project I'm working on.
>>
>> The lib is a gettext-like tool that allows translating strings based on a 
>> translations dictionary. I'd like to be able to include the lib as a 
>> dependency of the larger project and point to my translations dictionary 
>> from a setting in a configuration file (Ideally I would use project.clj to 
>> avoid having a lib specific file just for one setting).
>>
>> My problem is I'm not sure how to read a configuration file in my project 
>> from the generated JAR of the lib (if that's even possible and not a bad 
>> idea for some reason). I tried using configleaf 
>> <https://github.com/davidsantiago/configleaf> and it worked while I 
>> included the lib as a checkout project but it seems the config file gets 
>> freezed to whatever it is when the lib's JAR is packed.
>>
>> I wonder if there's a straightforward and idiomatic way to achieve this. 
>> "That's a terrible idea" type of answers are also welcome :P
>>
>> Thanks, 
>> Facundo.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to