Fork me on GitHub
#re-frame
<
2016-04-10
>
amacdougall18:04:09

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

amacdougall18:04:48

It's a dirty job maintaining and serving the strings files, but none of that effort is re-frame specific.

amacdougall18:04:45

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

leonfs20:04:09

Yeah.. that’s what I had in mind..

leonfs20:04:40

a simple function that will bring the text from a map

leonfs20:04:11

but it seems as an overkill..

leonfs20:04:55

I also asked if there was an approach based on re-frame, as the selected lang should be part of the initial state

leonfs20:04:15

maybe someone already implemented a few helper functions..

leonfs20:04:34

thanks @amacdougall for your input..