-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtext_import.sh
More file actions
executable file
·37 lines (34 loc) · 1.04 KB
/
text_import.sh
File metadata and controls
executable file
·37 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
PAK=pak64
CONFIRM=true
while getopts 'n' opt; do
case "$opt" in
n)
CONFIRM=false
;;
?|h)
echo "Usage: $(basename $0) [-n]"
exit 1
esac
done
wget -q --post-data "version=312&choice=all&submit=Export!" --delete-after https://translator.simutrans.com/script/main.php?page=wrap
wget -O texts.zip https://makie.de/translator/data/tab/language_pack-Scenario+Tutorial+$PAK.zip
mkdir tmp && cd tmp
unzip ../texts.zip
rsync -avr --exclude='en.tab' --exclude='_objectlist.txt' --exclude='_translate_users.txt' * ..
cd ..
rm -r tmp
rm texts.zip
if [ "$CONFIRM" = true ]
then
git diff
select yn in "Commit translations and push" "Keep changes but don't commit" "Cancel and reset"; do
case $yn in
"Commit translations and push" ) git add .; git commit -m "Translation: Import texts from Simutranslator"; git push; break;;
"Keep changes but don't commit" ) break;;
"Cancel and reset" ) git reset --hard origin/main; break;;
esac
done
else
git add .; git commit -m "Translation: Import texts from Simutranslator"; git push;
fi