Closed odorisioe closed 8 years ago
I am not sure how handlebars works. You might have to register a helper for the translation: http://stackoverflow.com/questions/7760332/how-to-make-i18n-with-handlebars-js-mustache-templates
Hi, thanks for the reply. The function works because when I use {{ 'hello' }} on the template, I can see "Hello, !" It looks like missing parameters or I am not setting properly. Also I am trying in Nunjucks and I have the same result
I tried in a lot of ways like {{ 'hello' name="TestName" }} {{ 'hello' "TestName" }}
Do you know how is the syntax for Jade ? Is the next template engine to test
There is an example of how to use it with Jade in the README at the beginning: https://github.com/codeva/hapi-i18n
I did it a pull request to the README with information about how use dynamic variables on Jade and Nunjucks. #8 I could not find the way for Handlebars
I have merged your pull request.. Thanks for the contribution.
I have the file ./locales/en.json
{ "hello": "Hello, {{name}}!" }
This work well in the controller if I do this:
return reply(request.i18n.__( "hello", {name: 'Emma'}));
But I can not make work on the template. I can use it without set the name
<p>{{__ 'hello' }}</p>
But in this example, this will look like "Hello, __!"Is there any way to add the field name on the template of handlebars? Thanks