welang
v1.0.0
Published
welang
Downloads
36
Readme
WELANG
生成翻译函数
Install
npm install welang --save
Usage
const { welang } = require('welang');
const weLANG = welang(translateData);
weLANG('中文'); // chinese
weLANG('中文', 'short'); // zh
weLANG('我是%s', ['Bacra']); // I‘m Bacra
weLANG('我是%s', ['Bacra'], { langs: 'hk' }); // 我是Bacra
const username = 'Bacra';
weLANG.t`我是${username}` // I‘m Bacra
weLANG.t({ langs: 'hk' })`我是${username}` // 我是Bacra