diff --git a/.scripts/chatgpt_translate.sh b/.scripts/chatgpt_translate.sh new file mode 100755 index 0000000000..88bce42ee5 --- /dev/null +++ b/.scripts/chatgpt_translate.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +WORK_DIR=.scripts +cd $WORK_DIR + +source utils/install_poetry.sh + +TEMP=tmp.po +TARGET=../$2 + +poetry lock +poetry install +poetry run bash -c " + python google_translate/main.py $2 $TARGET $3 > $TEMP + pomerge -t $TARGET -i $TEMP -o $TARGET +" +rm $TEMP diff --git a/.scripts/pyproject.toml b/.scripts/pyproject.toml index cdb505ad0e..34d3740eb4 100644 --- a/.scripts/pyproject.toml +++ b/.scripts/pyproject.toml @@ -10,6 +10,7 @@ python = "^3.10" polib = "1.1.1" googletrans = "3.1.0a0" translate-toolkit = "3.8.1" +requests = "2.31.0" [build-system]