Skip to content
Twing Intl Extension
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.editorconfig
.gitignore
.npmignore
.nycrc
.travis.yml
CHANGELOG
LICENSE
README.md
package-lock.json
package.json
tsconfig.json

README.md

Twing Intl

NPM version Build Status Coverage percentage

Draft for twing Intl support seeIntl.php

TODO

  • what about timezone support? - skip // inclue other lib?
  • implement localizednumber
  • implement localizedcurrency

Example

Twig:

{{ datefield|localizeddate('full', 'short', app.request.locale ) }}

Usage

import { TwingLoaderFilesystem, TwingEnvironment } from "twing";
import { TwingExtensionIntl } from "twing-intl";

const loader = new TwingLoaderFilesystem('/path/to/templates');
const twing = new TwingEnvironment(loader);

twing.addExtension(new TwingExtensionIntl());
twing.addGlobal('app', {request: {locale: 'en'}});

Twing

Read the Twing Documentation for more information.

Contributing

  • Fork this repository
  • Code
  • Implement tests using tape
  • Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue

Thanks To

License

Copyright © 2019 Cornelius Weiss. Released under the 2-Clause BSD License.

You can’t perform that action at this time.