18n

0.0.1 • Public • Published

18n

A simple i18n module

Install

$ npm install 18n

Usage

18n will read the configuration from the 18n.config.js in your package root.

Configuration

// 18n.config.js
module.exports = {
  langPath: 'languages',
  langPacks: [
    'en-us',
    'zh-cn'
  ],
  selector: () => {
    const {language} = navigator;
    switch (language) {
      case 'zh':
      case 'zh-cn':
        return 'zh-cn';
      default:
        return 'en-us';
    }
  }
};

License

MIT © LitoMore

Readme

Keywords

Package Sidebar

Install

npm i 18n

Weekly Downloads

10

Version

0.0.1

License

MIT

Unpacked Size

2.55 kB

Total Files

4

Last publish

Collaborators

  • litomore