Plug-ins

Plug-ins can be configured in .i18n/conf.yml, such as:

addon:
  - i18n.addon/toc

Official Plug-ins

File Name Convention

Plug-ins 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 agreed-upon files of the plug-in package and then execute them.

The agreed file names are as follows:

htmIndex.js

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

__CONF__ will be replaced with the name of the current configuration (e.g., 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, for example:

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

file: Output file list, path: File path, txt: File content.

Built-in Functions

The built-in js runtime is based on boa and has the following built-in functions:

Development Guide

Plug-in development can refer to https://github.com/i18n-site/addon