The hi5.template library is a browser side, Javascript library which enables you to fuse Javascript data and logic into your HTML. It simplifies writing localized apps by providing a message resource tag:
<os:message key=”resource” />which eliminates the need to build messages and HTML with Javascript. To ease transitioning to language resource files, you can provide the message resource directly in the message tag. For example:
Also, using the hi5.template library allow future compatibility with our user generated content inline-translation tool. The template is straightforward, with only a few conventions:
<os:message key=”received_gift” gift=”pizza” friend=”Joe”>You received a ${gift} from ${friend}</os:message>
- ${} for variable substitution
- <for-each> for iteration
- <if>/<else> for conditional logic, and
- <os:message> for gadget resource localization.
Check out the wiki for more details on the template library: where to download it, how to specify it within your application and the format for various tags.
Leave a comment