ya-locale

Locale file loader and producer

Usage no npm install needed!

<script type="module">
  import yaLocale from 'https://cdn.skypack.dev/ya-locale';
</script>

README

ya-locale

Build Status npm version

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.

require("ya-locale").load("path/to/locale");

const locale = require("ya-locale");

locale("example", "zh");
// ==> 示例