flickr / handlebars-intl

Handlebars helpers for internationalization.

Home Page:http://formatjs.io/handlebars/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

handlebars-intl

Handlebars helpers for internationalization.

Build Status

Installation

Browser

  1. Install with bower: bower install handlebars-intl

  2. 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>
  3. Register the helpers:

    HandlebarsHelperIntl.register(Handlebars);

Node/CommonJS

  1. You can install the helpers with npm: npm install handlebars-intl

  2. 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. The intl NPM package can provide this or you can use another.

AMD

  1. Install with bower: bower install handlebars-form-helpers

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

Usage

TODO

About

Handlebars helpers for internationalization.

http://formatjs.io/handlebars/

License:Other


Languages

Language:JavaScript 86.2%Language:HTML 12.5%Language:Shell 1.3%