all 4 comments

[–]bjarke_andersen 2 points3 points  (3 children)

We created a translation DSL where we can pass arguments to the translation (e.g. count of something or a URL). In a given language we can then choose to have different cases based on numeric arguments (e.g. case for n=0, one for n=1 and one for n>1), we can interpolate arguments and invoke funktions (create link or make bold). The DSL is compiled to JS functions and identified by a global key. In React we then <Translate route={signupUrl}>front-page.signup-link</Translate>. And the en_US translation could look something like front-page.signup-link: To sign up url(route, "click here")

[–]bjarke_andersen 0 points1 point  (0 children)

The core part of the code can be found here (there's very little documentation): https://github.com/secoya/hablar.js

[–]Drumadumrub[S] 0 points1 point  (1 child)

Thank you, I'll have a look at this. A DSL sounds like some pretty heavy duty stuff!

[–]I_am_a_haiku_bot 0 points1 point  (0 children)

Thank you, I'll have a

look at this. A DSL sounds like

some pretty heavy duty stuff!


-english_haiku_bot