Handlebars helpers for internationalization.
-
Install with bower:
bower install handlebars-intl
-
Load the scripts into your page. (It does not matter which order the scripts are loaded in.)
<script src="handlebars.js"></script> <script src="handlebars-intl.js"></script>
-
Register the helpers:
HandlebarsHelperIntl.register(Handlebars);
-
You can install the helpers with npm:
npm install handlebars-intl
-
Load in the module and register it:
var Handlebars = require('handlebars'); global.Intl = require('intl'); require('handlebars-intl').register(Handlebars);
NOTE: Since node (as of 0.10) doesn't provide the global
Intl
object (ECMA-402) you'll need to provide a polyfill. Theintl
NPM package can provide this or you can use another.
-
Install with bower:
bower install handlebars-form-helpers
-
Load in the module and register it:
define(['handlebars', 'handlebars-intl'], function(Handlebars, HandlebarsHelperIntl) { HandlebarsHelperIntl.register(Handlebars); });
(Thanks to the handlebars-form-helpers
package for figuring out how to register helpers in multiple environments.)
TODO