I have a template public/js/templates/info.html:
<div class="info">
<div class="button">&{'info.close'}</div>
<div class="info-title"><%= title %></div>
<div class="info-text"><%= description %></div>
</div>
&{'info.close'} should print the "Close Info" text from messages - but in web page I see "&{'info.close'}".
This work perfectly in a html view, but it doesn't work for templates. I am using JavaScript templates as that comes with backbone.js/underscore.js.
How can I achieve this?
You can use the i18n tag
Resources in the public directory are considered static data items. They are not processed by Play through the templating engine, but instead just served up as is.
If you want to make use of dynamic data, which includes internationalised javscript files, you have a couple of options.
Your specific requirements will determine which is the right approach for your application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With