Python script that translates [Chinese --> English] map text from StripperCS2 'JSON' format by using Google Translate API
- Support multiple map lump text data files from StripperCS2 format
- Export Workshop_ID and Workshop Name in json
- Using Google Translate API for translate
Important
This script support only translate Chinese to English only!
If you provide others langauge, Output will be the same!
- Python (version 3.9.11 atleast)
- All dependencies in
requirements.txt
Install python and then download this repository, Extract the zip file in any folder and run install.bat file to install
all Python dependencies in this script are required
Note
install.bat file will automatically create virtual environment and activate it for you
Warning
If you have a problem with installing dependencies while running install batch file
Try to run pip install pandas requests beautifulsoup4 googletrans in any bash shell
or you can see all libraries using in requirements.txt
- Open PowerShell or CMD on the working directory that has
translate_script.pyfile stored - Type
python translate_script.pyto run the script (The script will automatically createdataanddata/exportdirectories) - Put all map lump text data files you want to translate in
dataand follow the script - Output file will be create at
data/exportwith the same name and same JSON StripperCS2 structure
{
"modify": [
{
"match": {
"io": [
{
"overrideparam": "say 左乐:此次前赴大荒城,有博士协助,想必路途会轻松不少"
}
]
},
"replace": {
"io": {
"overrideparam": ""
}
}
},
{
"match": {
"io": [
{
"overrideparam": "say 左乐:博士,前方道路开放还有20s"
}
]
},
"replace": {
"io": {
"overrideparam": ""
}
}
}
]
}{
"modify": [
{
"match": {
"io": [
{
"overrideparam": "say 左乐:此次前赴大荒城,有博士协助,想必路途会轻松不少"
}
]
},
"replace": {
"io": {
"overrideparam": "Say Zuo Le: This time I went to Dahuang City, with the help of a doctor, I guess the journey will be much easier"
}
}
},
{
"match": {
"io": [
{
"overrideparam": "say 左乐:博士,前方道路开放还有20s"
}
]
},
"replace": {
"io": {
"overrideparam": "Say Zuo Le: Doctor, the road ahead is open for 20 seconds"
}
}
}
]
}Sometimes script out with Operation Time Out or Exit code 200 or RunTimeWarning just re-run the script again or put the file want to translate more less
