o18n
organizing i18n files new way.
  • English
  • 繁體中文
  • 简体中文
  • 日本語
npm install --save o18n

Getting Started

import O18N from 'o18n';
const lang = new O18N({
  zh: { hello: '哈囉' },
  en: { hello: 'hello' },
});

/* Default is the first language */
console.log(lang.hello); // 哈囉

lang.locale = 'en';
console.log(lang.hello); // hello