apeman-service-locale

3.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i apeman-service-locale

Weekly Downloads

0

Version

3.0.1

License

MIT

Last publish

Collaborators

  • okunishinishi