default-globalize-messages
v0.1.2
Published
default message support for Globalize.messageFormatter
Downloads
5
Readme
default-globalize-messages
Default messages for Globalize.
Allows calls to Globalize.formatMessage and Globalize.messageFormatter to return themselves, for simplified development.
require("default-globalize-messages").set();
var formatter = Globalize.formatMessage("Hello {name}");
formatter({ name: "Andrew" });
// => "Hello Andrew"
Extracted from @kborchers's react-globalize project.
Dependencies
This has a peer dependency on Globalize - currently:
"globalize": ">= 1.0.0 || 1.1.0-alpha - 1.1.x"
Because peerDependencies
support in npm is not very good, it is listed as a
dev dependency in package.json
.
Usage
// simplest way, at the start of your script
require("default-globalize-messages").set();
License
MIT