0.5.0 • Published 8 years ago

wintersmith-l10n v0.5.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

wintersmith-l10n Build Status Dependency Status

A Wintersmith plugin to localize dates and times

Installation

Install globally or locally using npm:

npm install [-g] wintersmith-l10n

Add wintersmith-l10n to your config.json:

{
  "plugins": [
    "wintersmith-l10n"
  ]
}

Define the locale property:

{
  "locale": "en"
}

Usage

Get the current locale:

env.helpers.l10n.get();

Set a new locale:

env.helpers.l10n.set('en-GB');

Localize a date:

env.helpers.l10n.localize(new Date(), 'LL');

Localize a time:

env.helpers.l10n.localize(new Date(), 'HH:mm');

Please note that wintersmith-l10n relies on moment to format dates and times. So, any format supported by moment is also supported by wintersmith-l10n.

License

wintersmith-l10n is released under the MIT license.

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago