apeman-app-locale

apeman app for locale data.

"!!NO LONGER_MAINTAINED"
Last updated 4 years ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install apeman-app-locale 
SYNC missed versions from official npm registry.

apeman-app-locale

Build Status Code Climate Code Coverage npm Version JS Standard

apeman app for locale data.

Add dynamic locale with apemanlocale for requested lang.

Installation

$ npm install apeman-app-locale --save

Usage

  1. Define an app within Apemanfile.js
  2. Call the app via apeman app command.

Apemanfile.js

/** This is an example Apemanfile to use apeman-app-locale */

'use strict'

const loc = require('../../loc') // Apemanlocale instance.

module.exports = {
  $pkg: { /* ... */ },
  $apps: {
    // Define your own app.
    'my-app-01': {
      // Map url and handlers.
      '/': [
        require('apeman-app-locale')(
          loc,
          {}
        ),
        (req, res, next) => {
          let title = req.locale('titles.UI_TITLE') // Get locale message for requested lang.
          console.log(title)
          /* ... */
          next()
        }
      ]
    }
  }
}

Then,

$ apeman app my-app-01 -p 3000

Signature

apemanAppLocale(loc, options) -> function

apeman app for locale data.

Args
Name Type Default Description
loc Object Apemanlocale instance.
options Object Optional settings.
options.name string locale Name of property for request.

License

This software is released under the MIT License.

Links

Current Tags

  • 3.0.0                                ...           latest (4 years ago)

6 Versions

  • 3.0.0 [deprecated]           ...           4 years ago
  • 2.0.0 [deprecated]           ...           4 years ago
  • 1.1.2 [deprecated]           ...           4 years ago
  • 1.1.1 [deprecated]           ...           4 years ago
  • 1.1.0 [deprecated]           ...           4 years ago
  • 1.0.0 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (16)

Copyright 2014 - 2016 © taobao.org |