Fork me on GitHub
#clojurescript
<
2017-09-10
>
au-phiware02:09:47

@juanjo.lenero, I think you've found the simple (and recommended) way of improving the repl experience 🙂 If you want an even better experience you can use figwheel from within nrepl (or your repl of choice). I found that it took me a bit of time to get my head around and I'm not sure I quite understand it all but I now have a repl with tab completion as well as history which is just golden 🙂 https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl

andrea.crotti10:09:47

trying to find a nice way to handle two languages in clojurescript, and was going to use this library https://github.com/tonsky/tongue

andrea.crotti10:09:41

the only problem is that all the actual text can be quite nested in reagent data structures, like [:div {:id "something"} [:div "Hello"]]

andrea.crotti10:09:21

what would be nice is to not care about where the text I want to translate is, and simply do a single pass in each of the components

andrea.crotti10:09:11

assuming I have something like this instead: [:div {:id "something"} [:div :hello]] then using update-in or specter I could do a bulk translation

andrea.crotti10:09:17

any other approach I could have a look at otherwise?

the-kenny12:09:54

Maybe just do a tree-walk with clojure.walk?

reefersleep13:09:47

@andrea.crotti @the-kenny ‘s suggestion sounds good for what you want, but I don’t understand the why - you need to place signals the translation points somehow, so why not have the function call where you are going to put the anchor? Are you trying to decouple the translation points from the components?

tbaldridge14:09:45

It seems like the cleanest approach would be to do what most apps in other language do, and introduce a translation table. Whenever you need a string, call (table :hello).

reefersleep19:09:25

@tbaldridge isn't that pretty much what "tongue" is?