These are chat archives for ractivejs/ractive

9th
Sep 2016
rnofenko
@rnofenko
Sep 09 2016 23:09
Hi guys, does ractive have one way binding?
Martin Kolárik
@MartinKolarik
Sep 09 2016 23:10
yes, you can disable two way binding either per instance or for individual inputs
rnofenko
@rnofenko
Sep 09 2016 23:12
I see, thank you
what approach do you use to do multilanguage site?
Martin Kolárik
@MartinKolarik
Sep 09 2016 23:16
I usually do something like {{_("Text in English")}} where _ is a function that takes care of translating to the appropriate language
rnofenko
@rnofenko
Sep 09 2016 23:18
do you have solution for text interpolation like {{ _("Hello {{name}} in English") }} ?
Martin Kolárik
@MartinKolarik
Sep 09 2016 23:20
yes, the function can take sprintf-like strings {{__("Hello %s in English", name)}}
you could use any existing JS i18n library and just register it with Ractive
depends on if you also need pluralization, date formatting, etc.
rnofenko
@rnofenko
Sep 09 2016 23:23
translation is the most tedious part of internationalization. I didn't find easy solution. __("Hello %s in English", name) - this looks good
Martin Kolárik
@MartinKolarik
Sep 09 2016 23:28
yep, it has always worked for me so far