Skip to content

Commit 7a5139d

Browse files
committed
Add Chatgpt Translate Shell Script
Update pyproject.toml
1 parent 0fe7fe7 commit 7a5139d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.scripts/chatgpt_translate.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
WORK_DIR=.scripts
4+
cd $WORK_DIR
5+
6+
source utils/install_poetry.sh
7+
8+
TEMP=tmp.po
9+
TARGET=../$2
10+
11+
poetry lock
12+
poetry install
13+
poetry run bash -c "
14+
python google_translate/main.py $2 $TARGET $3 > $TEMP
15+
pomerge -t $TARGET -i $TEMP -o $TARGET
16+
"
17+
rm $TEMP

.scripts/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ python = "^3.10"
1010
polib = "1.1.1"
1111
googletrans = "3.1.0a0"
1212
translate-toolkit = "3.8.1"
13+
requests = "2.31.0"
1314

1415

1516
[build-system]

0 commit comments

Comments
 (0)