Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arstgit/ya-locale
Locale file loader and producer.
https://github.com/arstgit/ya-locale
Last synced: about 10 hours 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-24T15:31:20.000Z (almost 5 years ago)
- Last Synced: 2024-04-25T09:41:54.728Z (7 months 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
[![Build Status](https://travis-ci.org/derekchuank/ya-locale.svg?branch=master)](https://travis-ci.org/derekchuank/ya-locale)
[![npm version](https://badge.fury.io/js/ya-locale.svg)](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");
// ==> 示例
```