Translate parameters of RPGMaker plugin.
shell
npm install
`
Or install by npm directly:
`shell
npm install translate-rpgmaker-plugin
`
Or download single executable app from release page.
Config
Go to project directory, rename .env.example to .env and fill it on demand.
If using executable binary, put .env in the same directory.
`shell
DEEPL_KEY=
AZURE_KEY=
AZURE_REGION=
`
Get key from:
1. DeepL
3. Azure Text Translation
3. Google Cloud Translation
Or just copy text to existing translator manually.
Usage
Use this command in project directory:
`
node ./translate.js [options]
`
Or use use this command in anywhere:
`
npx translate-rpgmaker-plugin [options]
`
Or use single executable app:
`
./translate-rm [options]
`
* On Windows:
`
.\translate-rm.exe [options]
`
Options
`
Arguments:
plugin plugin path
Options:
--src source language
--target target language
--txt translated text file path to import (default: "")
--output output Directory (default: "./")
--engine translate engine type (choices: "deepl", "azure", "google", "manual", default: "manual")
--split-text for translate large amounts of text, but be aware of API quotas (default: false)
-h, --help display help for command
Translate engine types:
deepl
needs DEEPL_KEY in env vars
azure
needs AZURE_KEY and AZURE_REGION in env vars
google
use $ gcloud auth application-default login
manual
will generate txt file for manual translation (ex. website version of google translate, microsoft word, etc..)
`
Available languages:
1. DeepL
3. Azure Text Translation
3. Google Cloud Translation
Programming
`js
import translatePlugin from "translate-rpgmaker-plugin";
const options = {
pluginPath: "path/to/plugin/xxx.js",
srcLang: "en",
targetLang: "zh",
outputDir: "path/to/output", // default: "./"
engineType: "deepl", // default: "manual"
txtPath: "path/to/import/xxx.txt", // default: ""
splitText: false, // default: false
};
await translatePlugin(options);
``