Hello everyone,

I have a ClojureScript project and I'd like to extract the text to be 
translated at compile time. The inspiration comes from an Elixir library 
<https://github.com/elixir-lang/gettext>, as explained in this video 
<https://www.youtube.com/watch?v=IiP_cTfzk_o>.

I'm able to extract interesting information from inside the macro with (meta 
&form):

(defmacro t [key]
  (when gettext-flag (add-key! (merge {:key key} (meta &form))))
  `(translate ~key))

At this point I simply accumulate the data into a data structure BUT, the 
real problem is "knowing" when to write the accumulated information.

I looked for a way to detect ClojureScript compilation phases but didn't 
find any information on internet. I tried to do it with core.async and a 
debounce mechanism but 1. it's ugly and 2. it didn't work.

Would someone have an idea on how to cleanly fire the "write file" action 
when the compilation phase finishes?

Thanks 1. for creating Clojure(Script) 2. for an answer.

Damien

-- 
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