Hi! I have developed a Node.js package that can automatically add different language versions of plugin comments using translation services.
It can be used to assist in using foreign language plugins and to help display your own developed plugins in different languages.
For the latest detailed information, please visit the Github page.
Usage:
First, go to the Release page on Github to download and unzip the file.
This is a command-line tool, so you need to open a command line (cmd, powershell, unix shell, etc.).
Then, write the path to translate-rm.exe, followed by the parameters:
There are three translation services to choose from: DeepL, Azure, and Google. However, you need to apply for your own API key. Click on the name of each translation service to go to the API key tutorial page.
After obtaining the API key, you need to create a .env file to store it, or you can directly rename the .env.example file in the zip file to .env. You can even set it directly in the environment variables.
The variable names are as follows:
DEEPL_KEY needs to be filled in if you are using DeepL translation, AZURE_KEY and AZURE_REGION need to be filled in if you are using Azure translation service. For Google, the default login authorization method of its gcloud tool is used.
You can also use manual translation: --engine=manual, which will output a .txt file next to the tool. Copy the text inside to any existing translation tool, translate it, and then save it as a .txt as well.
Then, enter the command again, but add an additional parameter at the end: --txt=<translated .txt path>, the plugin notes of that language will be added to the plugin.
Available translation tools include Microsoft Word, Google Doc, or Google Translate website for small amounts of text.
Regarding the language codes of the --src and --target parameters, each translation service supports different translatable languages. For details, please refer to the following pages:
TODO:
At least one block should not have a language tag, that is, it is used as the default block, otherwise the program will not be able to find the comments to translate.
It can be used to assist in using foreign language plugins and to help display your own developed plugins in different languages.
For the latest detailed information, please visit the Github page.
Usage:
First, go to the Release page on Github to download and unzip the file.
This is a command-line tool, so you need to open a command line (cmd, powershell, unix shell, etc.).
Then, write the path to translate-rm.exe, followed by the parameters:
Code:
D:\translate-rm.exe <plugin path> --src=<original language> --target=<target language> --engine=<translation service>
There are three translation services to choose from: DeepL, Azure, and Google. However, you need to apply for your own API key. Click on the name of each translation service to go to the API key tutorial page.
After obtaining the API key, you need to create a .env file to store it, or you can directly rename the .env.example file in the zip file to .env. You can even set it directly in the environment variables.
The variable names are as follows:
Code:
DEEPL_KEY=
AZURE_KEY=
AZURE_REGION=
DEEPL_KEY needs to be filled in if you are using DeepL translation, AZURE_KEY and AZURE_REGION need to be filled in if you are using Azure translation service. For Google, the default login authorization method of its gcloud tool is used.
You can also use manual translation: --engine=manual, which will output a .txt file next to the tool. Copy the text inside to any existing translation tool, translate it, and then save it as a .txt as well.
Then, enter the command again, but add an additional parameter at the end: --txt=<translated .txt path>, the plugin notes of that language will be added to the plugin.
Available translation tools include Microsoft Word, Google Doc, or Google Translate website for small amounts of text.
Code:
D:\translate-rm.exe <plugin path> --src=<original language> --target=<target language> --engine=manual --txt=<translated .txt path>
Regarding the language codes of the --src and --target parameters, each translation service supports different translatable languages. For details, please refer to the following pages:
TODO:
- Translate and add multiple languages at once (currently, you can only use the command again on the translated plugin to add them one by one)
- Obtain the comment block to be translated based on the input language (currently, a default comment block is required, as shown in the example below)
At least one block should not have a language tag, that is, it is used as the default block, otherwise the program will not be able to find the comments to translate.