@airx/i18n

The i18n project for AirX

Usage no npm install needed!

<script type="module">
  import airxI18n from 'https://cdn.skypack.dev/@airx/i18n';
</script>

README

@airx/i18n

npm npm npm codebeat badge

贡献指南

English Version: Contributing Guide

  • src 目录下,各语言建立单独的文件夹,命名规则采用纯小写,短破折号-连接,如zh-cn
  • 使用 YAML 语言进行翻译维护
  • 原则:
    1. 根据专业术语分类或功能模块(如禁飞区nofly)进行区分汇总
    2. 相同翻译单词(如 org: 组织)不重复出现
    3. 日常用于翻译统一归放于common

p.s. 团队成员进行代码贡献维护时,请勿直接在master下进行修改,创建自己的分支进行提交。

安装及使用

yarn add @airx/i18n
# or
npm i --save @airx/i18n

示例:

const Vue = require('vue');
const VueI18n = require('vue-i18n');
const { zhCN, enUS } = require('@airx/i18n');

Vue.use(VueI18n);
const i18n = new VueI18n({
  locale: 'zh-CN',
  fallbackLocale: 'zh-CN',
  messages: {
    'en-US': enUS,
    'zh-CN': zhCN
  }
});

module.exports = i18n;

LICENSE

Apache-2.0