how to do variable replacement in mustache template with express?
how to do variable replacement in mustache template with express?
maybe you could outline your use case a bit more?
Hello, Is there any relationship with this ticket? https://github.com/codeva/hapi-i18n/issues/7
probably... thing is that some template engines handle parameter passing differently:
<%= __('Hello') %>
${__('Hello')}
<%= __('Hello {{name}}', { name: 'Marcus' }) %>
${__('Hello {{name}}', { name: 'Marcus' })}
from handlebars docs http://handlebarsjs.com/expressions.html
Handlebars helpers can also receive an optional sequence of key-value pairs as their final parameter (referred to as hash arguments in the documentation):
{{{link "See more..." href=story.url class="story"}}}
one should be able to setup a helper handling stuff like this:
{{{__ 'Hello {{name}}' name='Marcus'}}}
but this is just guess and probably needs some work to implement by yourself (see https://github.com/mashpie/i18n-node#attaching-helpers-for-template-engines)
I'll check to find some reasonable default implementation + example as soon I find time to