当前位置:网站首页>Operation instructions of star boundary automatic text translator (advanced version)
Operation instructions of star boundary automatic text translator (advanced version)
2022-04-23 14:11:00 【Senzhiqianshou】
Preface
The advanced version of automatic text translator has finally been developed , Previously, pure html Develop the graphical interface of , But it's not automatic enough , Need to manually locate file copy overwrite . Theories like this can be used python Development , But I only know the front end and Android . So I found a compromise , use nodeJS Development .
Tool features
Cross platform
Support multiple operating systems , Include Windows、Linux、Mac
Baidu translation API
Use free ( The standard version ). Support term base ( premium ). The advanced version has a month 200 Million free character access . Standard Edition unlimited use . Because of the shit stick, especially FU There are many new words in it , Adopt term base , It can greatly reduce the problem of inaccurate translation .
Automatic translation
Just a simple command , Can automatically translate all files in the specified directory
Use the tutorial
One 、 Register Baidu translation account , obtain key and appid
You can refer to the previous Semi automatic translation tutorial
Two 、 Installation configuration node
1、 Download installation package
Get into node Official website , Select the platform version corresponding to your system , With windows For example , branch 32 Bit version and 64 Bit version , If you don't clear it, choose 32 position , because 64 Bit compatible 32 Bit program , But today's systems are generally 64 Bit . After downloading, double-click install , No brain, just click next .

2、 Check whether the installation is successful
win+R Call out ’ function ‘, Input cmd

determine , Open the terminal , type
node -v
If you can see it node Version information for , Proof of successful installation

It should be noted that , If your account is not Administrator Account , This step and even subsequent steps may fail . Then you need to call Administrator authority PowerShell. The opening mode is , Hold down shift Right click at the same time win The logo of :

3、 Download the configuration tool file
Download address :github Portal
Enter the root directory of the source code , It's better not to have Chinese path , In the blank area shift+ Right click , Call up here to open powershell

Type the following command for dependent installation .
npm install

The above picture is a successful screenshot . There may be anti-virus software alarm during installation , allow . In addition, as mentioned earlier , No Adminstrtor In terms of account , Running instructions may fail , Just open the administrator's powershell then cd Enter the source directory for installation .
Next, find the root directory project.config.js file

/** * Baidu translation api Of key * @type {string} */
const BD_TRANSLATE_KEY = ''
/** * Baidu translated api Of appid * @type {string} */
const BD_TRANSLATE_APP_ID = ''
/** * The delay between translated documents , Too often can lead to api Call failed * @type {number} millisecond */
const TRANSLATE_DELAY = 5000
/** * Whether to overwrite the translation * @type {boolean} true-- The previous translation will cover the translation false-- Filter out the previously translated */
const TRANSLATE_COVER = false
/** * The source of the translation directory * @type {string} */
const TARGET_PATH='G:\\workspace\\StarBound\\FrackinUniverse-sChinese-Project\\translations\\texts\\objects\\mantizi'
The relevant configuration is described above , The first two items are translated by Baidu key and appid, It should be noted that TARGET_PATH This target source directory ,windows The file separator under is \, And fill in , To add escape characters , That is, two backslashes .
thus , The project configuration is completed , The next step is to translate instructions .
3、 ... and 、 Perform translation
What we need to do is src Under the folder exe.js file , So first cd Into the src Catalog , Run again node Instructions
PS G:\workspace\StarBound\starbound_auto_transalator_advanced> cd .\src\
PS G:\workspace\StarBound\starbound_auto_transalator_advanced\src> node .\exe.js
On the surface of the above TARGET_PATH For example , After this command is executed, a message appears
[G:\workspace\StarBound\FrackinUniverse-sChinese-Project\translations\texts\objects\mantizi\imperialbanner1\imperialbanner1.object.json
]
File opened successfully :3 Ready to read :
Translation results
The current file has been translated completely , Skip the file
------------------------------------------------------------------
Currently processing file No 2 File :
[G:\workspace\StarBound\FrackinUniverse-sChinese-Project\translations\texts\objects\mantizi\imperialbanner2\imperialbanner2.object.json
]
File opened successfully :4 Ready to read :
Find text to be translated :
{
'0': 'A beautifully woven banner.',
'1': 'A bright woven banner. I wonder what the jewel in the middle means.',
'2': 'A sun? Or some kind of creature?',
'3': 'A thick woven banner depicting the imperial crest.',
'4': 'Floran usually avoid this sssymbol.',
'5': 'I enjoy the golden accents woven into the fabric.',
'6': 'Is the Empire nearby?',
'7': 'Mantizi Imperial Banner',
'8': 'Servire Imperium.',
'9': 'This banner looks like it has a beetle woven on it.'
}
Request parameter composition result :
A beautifully woven banner.
A bright woven banner. I wonder what the jewel in the middle means.
A sun? Or some kind of creature?
A thick woven banner depicting the imperial crest.
Floran usually avoid this sssymbol.
I enjoy the golden accents woven into the fabric.
Is the Empire nearby?
Mantizi Imperial Banner
Servire Imperium.
This banner looks like it has a beetle woven on it.
Translation results
[
{
src: 'A beautifully woven banner.', dst: ' Weave exquisite flags .' },
{
src: 'A bright woven banner. I wonder what the jewel in the middle means.',
dst: ' Bright woven banners . I want to know what the jewelry in the middle means .'
},
{
src: 'A sun? Or some kind of creature?', dst: ' The sun ? Or some kind of creature ?' },
{
src: 'A thick woven banner depicting the imperial crest.',
dst: ' A thick woven banner depicting a crown .'
},
{
src: 'Floran usually avoid this sssymbol.', dst: ' Florian usually avoids using this symbol .' },
{
src: 'I enjoy the golden accents woven into the fabric.',
dst: ' I like the golden accent woven into the fabric .'
},
{
src: 'Is the Empire nearby?', dst: ' Is the Empire nearby ?' },
{
src: 'Mantizi Imperial Banner', dst: ' Mantiz Empire flag ' },
{
src: 'Servire Imperium.', dst: ' Imperial service .' },
{
src: 'This banner looks like it has a beetle woven on it.',
dst: ' This banner seems to be weaving a beetle .'
}
]
------------------------------------------------------------------
Recombination result
[
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'A beautifully woven banner.', Chs: ' Weave exquisite flags .' }
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'A bright woven banner. I wonder what the jewel in the middle means.',
Chs: ' Bright woven banners . I want to know what the jewelry in the middle means .'
}
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'A sun? Or some kind of creature?', Chs: ' The sun ? Or some kind of creature ?' }
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'A thick woven banner depicting the imperial crest.',
Chs: ' A thick woven banner depicting a crown .'
}
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'Floran usually avoid this sssymbol.',
Chs: ' Florian usually avoids using this symbol .'
}
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'I enjoy the golden accents woven into the fabric.',
Chs: ' I like the golden accent woven into the fabric .'
}
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'Is the Empire nearby?', Chs: ' Is the Empire nearby ?' }
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Chs: 'Mantizi Empire banner ', Eng: 'Mantizi Imperial Banner' }
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Chs: ' Serve the Empire .', Eng: 'Servire Imperium.' }
},
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialbanner2/imperialbanner2.object': [Array]
},
Texts: {
Eng: 'This banner looks like it has a beetle woven on it.',
Chs: ' This banner seems to be weaving a beetle .'
}
}
]
From the information on the console, you can see the information of the current translation file , When the configuration does not overwrite the translation , Will automatically skip the translated files , Increase translation efficiency .
There will also be corresponding prompts after successful translation :
Currently processing file No 35 File :
[G:\workspace\StarBound\FrackinUniverse-sChinese-Project\translations\texts\objects\mantizi\shared_imperialvaselarge\shared_imperialvas
elarge.json]
File opened successfully :4 Ready to read :
Find text to be translated :
{
'0': 'A large decorative glazed vase.' }
Request parameter composition result :
A large decorative glazed vase.
Translation results
[ {
src: 'A large decorative glazed vase.', dst: ' A large decorative glass vase .' } ]
------------------------------------------------------------------
Recombination result
[
{
DeniedAlternatives: [],
Files: {
'objects/mantizi/imperialvaselarge1/imperialvaselarge1.object': [Array],
'objects/mantizi/imperialvaselarge2/imperialvaselarge2.object': [Array]
},
Texts: {
Eng: 'A large decorative glazed vase.', Chs: ' A large decorative glass vase .' }
}
]
*********** All documents have been translated **********
Four 、 Set up the term library
This step is not necessary , However, setting up a term base can increase the accuracy of translation , At present, I have collected some information about minerals 、 Liquid and NPC Terms related to names , The file in doc Below directory :

stay Baidu translation platform You can configure the

版权声明
本文为[Senzhiqianshou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231405036828.html
边栏推荐
猜你喜欢

RobotFramework 之 文件上传和下载

微信小程序通过低功耗蓝牙设备进行定位及测距(二)

微信小程序进行蓝牙初始化、搜索附近蓝牙设备及连接指定蓝牙(一)

Visio installation error 1:1935 2: {XXXXXXXX

帆软中根据分类进行汇总

帆软报表设置单元格填报以及根据值的大小进行排名方法

星界边境文本自动翻译机使用说明

On the multi-level certificate based on OpenSSL, the issuance and management of multi-level Ca, and two-way authentication
Check in system based on ibeacons

HyperBDR云容灾V3.2.1版本发布|支持更多云平台,新增监控告警功能
随机推荐
gzip和gunzip 解压参数详解
Mock测试
win10自带Groove音乐不能播放CUE和APE文件的一种曲线救国办法,自己创建aimppack插件包,AIMP安装DSP插件
mysql 5.1升级到5.66
pthread_ Why does self() repeat
Windos中安装labellmg教程
Operation instructions of star boundary text automatic translator
VMware15Pro在Deepin系统里面挂载真机电脑硬盘
烟雾传感器(mq-2)使用详细教程(基于树莓派3b+实现)
全局变量能否放在头文件中定义
帆软中使用if else 进行判断-使用标题条件进行判断
RobotFramework 之 用例执行
Easyexcel读取excel表地理位置数据,按中文拼音排序
帆软分割求解:一段字符串,只取其中某个字符(所需要的字段)
Homebrew是什么?以及使用
GFS分布式文件系统(理论)
mysql 5.1升级到5.610
PyMySQL
Kettle -- control parsing
微信小程序调用客服接口