i18nlet
v0.2.1
Published
Internationalization library. (NodeJS, Browser)
Downloads
47
Readme
:globe_with_meridians: i18nlet
It is a simple internationalization library. (NodeJS, Browser)
:scroll: Releases
Detailed changes for each release are documented in the releases.
:book: Documentation
:rocket: Install
brower: script tag
Direct Download / CDN
<script src="https://unpkg.com/i18nlet/dist/iife.i18nlet.js"></script>
other release files
- amd.i18nlet.js
- amd.i18nlet.js.map
- amd.i18nlet.min.js
- cjs.i18nlet.js
- es.i18nlet.js
- iife.i18nlet.js
- iife.i18nlet.js.map
- iife.i18nlet.min.js
NPM
npm install --save i18nlet
bower
TODO
Custom Build
You will have to clone directly from GitHub and build i18nlet yourself if you want to use the latest dev build.
git clone https://github.com/fkei/i18nlet.git
npm install
npm run release
---
出力ファイル
├── dist
├── amd.riot-i18nlet.js
├── amd.riot-i18nlet.js.map
├── amd.riot-i18nlet.min.js
├── cjs.riot-i18nlet.js
├── es.riot-i18nlet.js
├── iife.riot-i18nlet.js
├── iife.riot-i18nlet.js.map
└── iife.riot-i18nlet.min.js
:checkered_flag: Getting started
HTML/JavaScript
<script src="https://unpkg.com/i18nlet/dist/iife.i18nlet.js"></script>
<script>
var i18nlet = new I18nlet().init();
i18nlet.loads({
` ja: {
'emoji.happy': ':)',
hello: 'こんにちは {{name}} {{emoji.happy}}',
},
en: {
'emoji.happy': ':)',
hello: 'Hello {{name}} {{emoji.happy}}',
},`
});
var message = i18nlet.i('hello', { name: 'fkei' });
console.log(message); // output: 'Hello fkei :)'
var message1 = i18nlet.i('hello', { name: 'fkei' });
console.log(message1); // output: 'こんにちは fkei :)'
</script>
Develop
eslint
$ npm run eslint
test
$ npm test