wok-6.x view tramys-client/stuff/tramys2 @ rev 17082

Up: tramys-server and tramys-client (140824).
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Aug 24 22:46:59 2014 +0300 (2014-08-24)
parents 096a77a2021d
children e96aa956e72e
line source
1 #!/bin/sh
2 # tramys - TRAnslate MY Slitaz. Client solution
3 # Tool for managing translation files for SliTaz GNU/Linux
4 # Aleksej Bobylev <al.bobylev@gmail.com>, 2014
6 . /etc/slitaz/slitaz.conf
7 . /lib/libtaz.sh
9 if [ $(id -u) != 0 ]; then
10 exec tazbox su $0 $@; exit 0
11 fi
13 export TEXTDOMAIN='tramys' # i18n
14 WORKING=$(mktemp -d)
15 LOG="/tmp/tramys.log"
16 TGZ="/tmp/tramys.tgz"
17 YADCONF="--center --window-icon=config-language --image=config-language --image-on-top"
19 yad $YADCONF --title="tramys (1/3)" --text="$(_ \
20 'Now translations for all installed programs will be found and downloaded.
21 You can change locale if you want, or proceed.
23 Your current locale: <b>$LANG</b>')" \
24 --button "gtk-edit:2" --button "gtk-cancel:1" --button "gtk-go-forward:0"
25 case $? in
26 2) tazbox locale; exit 0 ;;
27 1) exit 0 ;;
28 esac
30 busybox wget -U "$(cd $INSTALLED; ls -1 | tr '\n' ' ')" \
31 "http://cook.slitaz.org/tramys2.cgi?lang=$LANG&rel=$(cat /etc/slitaz-release)" \
32 -O - | tee $LOG | \
33 yad $YADCONF --title="tramys (2/3)" --progress --width=320 --text="$(_ \
34 'The server processes the request.
35 Please wait.')" \
36 --enable-log --log-expanded \
37 --button "gtk-cancel:1" --button "gtk-go-forward:0"
38 case $? in
39 1) exit 0 ;;
40 esac
42 DLKEY=$(tail -n1 $LOG); rm -f $LOG
44 busybox wget "http://cook.slitaz.org/tramys2.cgi?dl=$DLKEY" -O $TGZ 2>&1 | \
45 yad $YADCONF --title="tramys (3/3)" --progress --pulsate --width=320 \
46 --text="$(_ \
47 'Downloading in progress.
48 Please wait.')" \
49 --button "gtk-cancel:1" --button "gtk-ok:0"
50 case $? in
51 1) exit 0 ;;
52 esac | \
54 busybox tar -xz -C $WORKING -f $TGZ
55 chown -R root:root $WORKING
56 cp -fpr $WORKING/* /
57 rm -f $TGZ
58 rm -rf $WORKING
60 yad $YADCONF --title="tramys" --text="$(_ \
61 'Translation files have been installed in your system.')"