https://github.com/arstgit/ya-locale
Locale file loader and producer.
https://github.com/arstgit/ya-locale
Last synced: 21 days ago
JSON representation
Locale file loader and producer.
- Host: GitHub
- URL: https://github.com/arstgit/ya-locale
- Owner: arstgit
- License: mit
- Created: 2020-01-24T14:07:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-24T15:31:20.000Z (over 5 years ago)
- Last Synced: 2024-04-25T09:41:54.728Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ya-locale
[](https://travis-ci.org/derekchuank/ya-locale)
[](http://badge.fury.io/js/ya-locale)## Super simple to use
A simple locale loader and producer, support `json` only.
## Installation
```
npm install ya-locale
```## Usage
Firstly, you will be needed to create a `locale` directory including `en.json`, `zh.json` ,`jp.json`, etc.
Load your locale directory before you need using them.
```js
require("ya-locale").load("path/to/locale");const locale = require("ya-locale");
locale("example", "zh");
// ==> 示例
```