3.0.1 • Published 9 years ago
apeman-service-locale v3.0.1
apeman-service-locale
Apeman service for locale.
Installation
$ npm install apeman-service-locale --saveUsage
#!/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
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.