3.0.1 • Published 7 years ago

apeman-service-locale v3.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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

ParamTypeDescription
args*

ApLocaleService Class

Service

new ApLocaleService(store, options)

Constructor of ApLocaleService class

ParamTypeDescription
storeObjectRedux store
optionsObjectOptional settings

service.getLang() -> string

Get lang settings

service.setLang(lang) -> Promise

ParamTypeDescription
langstringLang

service.localize(keypath, options) -> Promise

Localize message

ParamTypeDescription
keypathstringMessage key path
optionsObjectOptional settings

service.l(args) -> string

Alias for localize function

ParamTypeDescription
args*Args to resolve

License

This software is released under the MIT License.

Links

3.0.1

7 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago