makara-browserify

1.2.6 • Public • Published

makara-browserify

i18n transport for browserify-based apps served by Kraken.js

Use

var mb = require('makara-browserify');

mb.build(projectRoot, cb): Builds browserify requireable bundles exposing _languagepack for each locale in projectRoot/locales

mb.languagePackPath(locale): returns the path relative to the projectRoot/.build/ of the compiled assets, suitable for tacking onto the end of a CDN root or static server root for use in applications. Locale may be a string or a bcp47 style locale object, or a simple object with a language and country property.

mb.middleware() returns an Express middleware that sets res.locals.languagePackPath to the appropriate path relative to the built file root to be served. This requires res.locals.locale to be set appropriately, as in the express-bcp47 module.

Readme

Keywords

none

Package Sidebar

Install

npm i makara-browserify

Weekly Downloads

20

Version

1.2.6

License

Apache 2.0

Last publish

Collaborators

  • aredridel
  • grawk
  • pvenkatakrishnan
  • totherik