Plugin

Plugins can be configured in .i18n/conf.yml, such as:

addon:
  - i18n.addon/toc

Official Plugin

File Name Convention

Plugins are all npm packages.

The package corresponding to i18n.addon/toc above is https://www.npmjs.com/package/@i18n.addon/toc.

The plugin uses the latest version by default and checks for updates weekly.

If you want to fix the version, you can write i18n.addon/[email protected].

The translation command line i18n.site will install the convention file of the plug-in package and then execute.

The agreed file names are as follows

htmIndex.js

htmIndex.js will be injected to the end of .i18n/htm/index.js.

Where __CONF__ will be replaced with the name of the current configuration (such as dev or ol).

afterTran.js

It will be called after the translation is completed, and the parameters passed in are as follows.

The return value is a dictionary, such as

{
  file:{
    //  path: txt, for example :
    // "_.json": "[]"
  }
}

file is the output file list, path is the file path, and txt is the file content.

Built-in Functions

The built-in js runtime is based on the secondary development of boa, and the built-in functions are as follows:

Development Guide

For plug-in development, you can refer to https://github.com/i18n-site/addon