derby-lang-fs

0.5.1 • Public • Published

Derby Lang FS

Load a Derby Lang dictionary from the file system.

Installation

$ npm install derby-lang-fs --save

Usage

Add the middleware to your server file:

var langFs = require('derby-lang-fs');

expressApp
  // ...
  // ...
  .use(lang())
  .use(langFs({
    dir: '/path/to/dir'
  }))

Options

dir — The directory containing the language files.
path — The path to set the dictionary. Defaults to $lang.dict.

Example

Folder structure:

locale/
+-- en/
  +-- app/
    +-- index.json
+-- es/
  +-- app/
    +-- index.json

Model output:

{
  "$lang": {
    "dict": {
      "en": {
        "app": { /* index.json */ }
      },
      "es": {
        "app": { /* index.json */ }
      },
    }
  }
}

Package Sidebar

Install

npm i derby-lang-fs

Weekly Downloads

2

Version

0.5.1

License

MIT

Last publish

Collaborators

  • psirenny