This package has been deprecated
Author message:
move to @the-/loc ( https://github.com/the-labo/the/tree/master/packages/loc#readme )
the-loc
5.0.1 • Public • Published the-loc
Locale resolver for the-framework
Installation
$ npm install the-loc --save
Usage
Create a directory with name "loc" and put locale files like "en.json" there.
loc/en.json
{
"keys": {
"APP_NAME": "hello-world"
},
"titles": {
"WELCOME_TITLE": "Welcome to #{keys.APP_NAME}!"
}
}
loc/index.js
'use strict'
const {create: theLoc} = require('the-loc')
const env = theLoc({
en: require('./en')
})
module.exports = env
Then,
'use strict'
const loc = require('./loc/index.js')
let en = loc.bind('en')
console.log(en('titles.WELCOME_TITLE'))
API Guide
License
This software is released under the MIT License.
Links
Versions
Current Tags
- VersionDownloads (Last 7 Days)
Version History
- VersionDownloads (Last 7 Days)
Package Sidebar
Install
Weekly Downloads