This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-10
Channels
- # admin-announcements (1)
- # boot (464)
- # braid-chat (4)
- # cider (6)
- # cljs-dev (7)
- # cljsrn (1)
- # clojars (1)
- # clojure (26)
- # clojure-france (1)
- # clojure-japan (6)
- # clojure-russia (35)
- # clojure-uk (3)
- # clojurescript (25)
- # cursive (5)
- # hoplon (389)
- # om (20)
- # om-next (1)
- # onyx (5)
- # other-lisps (1)
- # overtone (9)
- # planck (12)
- # proton (7)
- # re-frame (10)
- # reagent (13)
- # ring (23)
- # spacemacs (11)
@leonfs: I've never done it, but I assume the answer is going to be roughly the same as any other client-side system—write all your components in terms of a strings file, like [:h1 (get-string :main-page-heading)]
. Do your best to include the locale-specific strings file at page load time instead of making a separate request for it.
It's a dirty job maintaining and serving the strings files, but none of that effort is re-frame specific.
If you don't want to invoke a CLJS function for every piece of text in your app, you'll have to get a lot more fancy with server-side preprocessing. There are a bunch of ways you could do this, but that's probably way outside of what you're asking...?
I found a library.. https://github.com/ptaoussanis/tower
I also asked if there was an approach based on re-frame, as the selected lang should be part of the initial state
thanks @amacdougall for your input..