当前位置:网站首页>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
边栏推荐
- mysql 5.1升级到5.611
- Win10 comes with groove music, which can't play cue and ape files. It's a curvilinear way to save the country. It creates its own aimpack plug-in package, and aimp installs DSP plug-in
- Operation instructions of star boundary text automatic translator
- 连接公司跳板机取别名
- Chapter I review of e-commerce spike products
- 基於CM管理的CDH集群集成Phoenix
- 帆软分割求解:一段字符串,只取其中某个字符(所需要的字段)
- Essential difference between restful WebService and gSOAP webservice
- Gartner预测云迁移规模大幅增长;云迁移的优势是什么?
- RobotFramework 之 项目框架
猜你喜欢

修改ddt生成的测试用例名称

使用开源调研工具Prophet是一种什么体验?

win10自带Groove音乐不能播放CUE和APE文件的一种曲线救国办法,自己创建aimppack插件包,AIMP安装DSP插件

squid代理
POI operation word template replaces data and exports word

Recyclerview advanced use (I) - simple implementation of sideslip deletion

使用DialogFragment的一些感受及防踩坑经验(getActivity、getDialog为空,cancelable无效等)

基于ibeacons三点定位(微信小程序)

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

帆软报表设置单元格填报以及根据值的大小进行排名方法
随机推荐
Jacob print word
pthread_ Why does self() repeat
mysql 5.1升级到5.68
Can global variables be defined in header files
使用Postman进行Mock测试
redis数据库讲解(四)主从复制、哨兵、Cluster群集
Pycharm连接远程服务器并实现远程调试
基于ibeacons签到系统
微信小程序与低功耗蓝牙通信-往硬件端发送数据(三)
Visio installation error 1:1935 2: {XXXXXXXX
微信小程序的订阅号开发(消息推送)
sql中出现一个变态问题
leetcode--380. O (1) time insertion, deletion and acquisition of random elements
关于云容灾,你需要知道这些
RobotFramework 之 用例执行
某政务云项目业务系统迁移调研实践
jacob打印word
gzip和gunzip 解压参数详解
squid代理
修改ddt生成的测试用例名称