README
apeman-service-locale
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
- ApLocaleService Class
Functions
ApLocaleService
create(args) -> 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 |
string
service.getLang() -> Get lang settings
Promise
service.setLang(lang) -> Param | Type | Description |
---|---|---|
lang | string | Lang |
Promise
service.localize(keypath, options) -> Localize message
Param | Type | Description |
---|---|---|
keypath | string | Message key path |
options | Object | Optional settings |
string
service.l(args) -> Alias for localize function
Param | Type | Description |
---|---|---|
args | * | Args to resolve |
License
This software is released under the MIT License.