Fork me on GitHub

@gadfly361 @hjrnunes: Having similarly structured EDN maps with different language entries and subscribing to the keys in the app-state, and, in one place setting the language by loading a that specific language's map into app-state, is also how I envisioned simple, homebrewed i18n in Clojure. I'm looking forward to actually implementing it in a Reagent app and watching the app react to me switching the language back and forth 🙂 For larger apps with a lot of entries, I guess you could do like I'm used to in Java and make 'sub-keys' for each subsection of the app, e.g. frontpage.title, profile.title etc


@tonsky just released an i18n approach too:


How do you attach/read/change metadata on an ratom? I see this in the source:

(defn atom
  "Like clojure.core/atom, except that it keeps track of derefs."
  ([x] (RAtom. x nil nil nil))
  ([x & {:keys [meta validator]}] (RAtom. x meta validator nil)))
which makes me think that you can pass a map with a meta key. But when I try and retrieve the metadata I get nil. (meta (reagent.core/atom nil {:meta {:loading true}})) ;; returns nil


@seantempesta: that would be (atom nil :meta {:loading true})


note the ampersand in the arg vector


Hey, wondering if there is anyway offhand to get the hiccup for a reagent component?


You could call it with ( ) instead of [ ]


I tried that but when i print the result it is a bunch of JS nonsense


although it does appear to have the hiccup at the very end


Hmm you could wrap the result of the function call with str or maybe use console.log with cljs-devtools (untested, but think it would work)


the js is coming from the event functions, onclick etc


I just want the hiccup in map form for testing the component basically


make sure given X props it returns certain patterns of hiccup


Unfortunately not near a comp, hopefully others will chime in :)


well thanks for the suggestions nonetheless