Open sontek opened 12 years ago
https://github.com/dmfrancisco/pystache seems to have added support as well?
Without knowing much about the options, if it's necessary to change Pystache in order to support i18n, I would be open to it. The keys for me would be to do so in a way that (1) is consistent with the documented spec (e.g. allow it to be turned off and on if it breaks the spec), and (2) allows people to swap in other implementations if there isn't "one" accepted way to do it. Are there any blog posts, etc. with more information that you've come across?
I was able to accomplish i18n by passing a translation function to the render:
def translate(text):
return 'my translation'
pystache.render('template', {'_': translate})
I'm using pystache + mustache.js to render same templates either client side or server side. Do you have any information on doing translations for mustache? I'd like to support multiple languages with my application.
Thanks