0.1.1 • Published 6 years ago

egg-i18next v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

egg-i18next

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-i18next --save

Usage

// {app_root}/config/plugin.js
exports.i18next = {
  enable: true,
  package: 'egg-i18next',
};

Configuration

// {app_root}/config/config.default.js
exports.i18next = {
  queryField: 'locale',
  cookieField: 'locale',
  cookieMaxAge: 365 * 24 * 60 * 60 * 1000, // 1 year
  loadPath: '/config/locale/{{lng}}.yml',
  init: { // initialization config for i18next, refer to https://www.i18next.com/configuration-options.html for more details.
    fallbackLng: 'en-US',
  },
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT