Handlebars helpers for internationalization.
This patch release improves source maps on dist/
files, and adds Browserify testing to CI. Also, we weren't keeping up our bower.json
file so we've removed official Bower support.
This feature release has updated locale data to fix zh-Hant
plus adds support for new locales, adds select-ordinal argument support to messages, and allows a "now" date to be specified in {{formatRelative}}
.
This release has vastly improved locale data in the following ways:
selectordinal
Support for MessagesThis release adds support for selectordinal
arguments in messages, which are just like plural
arguments, expect the ordinal pluralization rules are used; e.g., to display which birthday your about to have:
It's my {year, selectordinal,
one {#st}
two {#nd}
few {#rd}
other{#th}
} birthday!
now
Option to {{formatRelative}}
HelperAdded support for specifying the "now" value from which relative time is computed. This change adds a new now
hash option to the {{formatRelative}}
helper which will pass along that value to IntlRelativeFormat#format()
method.
Checkout the full set of changes since the last release for more details.
This patch release improves support for using Browserify or Webpack to bundle handlebars-intl
. Since the context of these tools is to bundle for the browser, this release will only include the English locale data in the bundle by default. (Previously the data for all locales would be included when bundling with Browserify or Webpack.)
When you need to support another locale in your app and you're using Browserify or Webpack, we recommend the following approach:
// app.js
var HandlebarsIntl = window.HandlebarsIntl = require('handlebars-intl');
// ...
<script src="/app.bundle.js"></script>
<script src="/handlebars-intl/dist/locale-data/fr.js"></script>
This will expose HandlebarsIntl
as a global object in the browser, allowing you to load the script for the locale data you need for the page or current request.
0
Fixed issue #47 where the Epoch timestamp 0
was incorrectly treated as a falsy value.
This release also includes improvements to source maps, making debugging easier.
This package has undergone tons of development since the initial public release, v0.1.0
, and is now ready for prime time!
PR #29: fixing custom formats by string
This fixes the option to pass a second argument as a string which represents a named custom formatter:
{{intlNumber NUM "foo"}}
{{intlDate 1390518044403 "bar"}}
It also fixes the message format for something like this:
the cost {price, number, foo} will be ready by {deadline, date, bar}
Where foo
is an Intl.NumberFormat
options object, and bar
is an Intl.DateTimeFormat
options object.