apeman-service-locale
Apeman service for locale.
Last updated 8 months ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install apeman-service-locale 
SYNC missed versions from official npm registry.

apeman-service-locale

Build Status npm Version JS Standard

Apeman service for locale.

Installation

$ npm install apeman-service-locale --save

Usage

#!/usr/bin/env node

'use strict'

const { ApLocaleService } = require('apeman-service-locale')
const { createStore } = require('redux')
const { reducer } = require('apeman-service-base')
const co = require('co')

co(function * () {
  let store = createStore(reducer)
  let service = new ApLocaleService(store)


}).catch((err) => console.error(err))

API

apeman-service-locale@3.0.0

Apeman service for locale.

Functions

create(args) -> ApLocaleService

Create the service instance

Param Type Description
args *

ApLocaleService Class

Service

new ApLocaleService(store, options)

Constructor of ApLocaleService class

Param Type Description
store Object Redux store
options Object Optional settings

service.getLang() -> string

Get lang settings

service.setLang(lang) -> Promise

Param Type Description
lang string Lang

service.localize(keypath, options) -> Promise

Localize message

Param Type Description
keypath string Message key path
options Object Optional settings

service.l(args) -> string

Alias for localize function

Param Type Description
args * Args to resolve

License

This software is released under the MIT License.

Links

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (14)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |