Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6bf0a8

Browse files
committed
feat(script): add shell script for running the google translation helper
1 parent796e24b commite6bf0a8

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

‎.scripts/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Scripts
2+
3+
Useful scripts for the translation.
4+
5+
##From Google Translation
6+
7+
Translate all untranslated entries of the given .po file with Google Translate.
8+
9+
10+
```sh
11+
.scripts/google_translate.sh library/csv.po
12+
```

‎.scripts/google_translate.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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=../$1
10+
11+
poetry install -q
12+
poetry run bash -c"
13+
python google_translate/main.py$TARGET >$TEMP
14+
pomerge -t$TARGET -i$TEMP -o$TARGET
15+
"
16+
rm$TEMP

‎.scripts/utils/install_poetry.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if [[!-x"`which poetry2>/dev/null`" ]]
2+
then
3+
read -p"You do not have poetry installed. Install now? (y/N)" choice
4+
case"$choice"in
5+
y|Y ) python -m pip install poetry;;
6+
n|N|* )echo"Aborted";exit 1 ;;
7+
esac
8+
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp