hi5 Providing Library For Templates

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:

<os:message key=”received_gift” gift=”pizza” friend=”Joe”>You received a ${gift} from ${friend}</os:message>
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:

  1. ${} for variable substitution
  2. <for-each> for iteration
  3. <if>/<else> for conditional logic, and
  4. <os:message> for gadget resource localization.
There is also a <set> tag for storing the output of tags, and <os:name> and <os:profile-pic> convenience tags.

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

Recent Entries

  • OpenSocial 0.8 Moved To Live Environment

    We have now finished the migration of the Platform in production to OpenSocial v0.8. We'd like to thank the developers who helped test 0.8 while...

  • Translation Service for OpenSocial Applications on hi5

    Reaching a Wider Audience: Community-based Translations for Applications Hi5 has a large audience in Spanish-speaking markets, Thailand, Romania, Portugal, and many other countries. How much...

  • OpenSocial 0.8 In Beta On hi5

    Following close behind the release of the OpenSocial 0.8 specification two months ago, we have been hard at work implementing it, and are happy to...

  • Statistics API Available on Sandbox

    The Statistics API that we announced two weeks ago is available on sandbox. Please use the endpoints described in the earlier post, prefixed with http://sandbox.hi5.com/rest....

  • hi5 Providing Library For Templates

    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...

Close