wok-current rev 17092

tramys-client, tramys-server: add i18n and Russian L10n; human readable archive size.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Aug 28 04:01:02 2014 +0300 (2014-08-28)
parents 8d9754bad0a1
children 1c8a8c24e47e
files tramys-client/receipt tramys-client/stuff/Makefile tramys-client/stuff/po/ru.po tramys-client/stuff/po/tramys.pot tramys-client/stuff/tramys2 tramys-server/receipt tramys-server/stuff/tramys2.cgi tramys-server/stuff/tramys2.msg
line diff
     1.1 --- a/tramys-client/receipt	Thu Aug 28 01:42:21 2014 +0200
     1.2 +++ b/tramys-client/receipt	Thu Aug 28 04:01:02 2014 +0300
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="tramys-client"
     1.7 -VERSION="140826"
     1.8 +VERSION="140828"
     1.9  CATEGORY="system-tools"
    1.10  SHORT_DESC="Tool for managing translation files for SliTaz GNU/Linux, client part"
    1.11  MAINTAINER="al.bobylev@gmail.com"
    1.12 @@ -16,4 +16,10 @@
    1.13  	install -Dm755 -o root $stuff/tramys2 $fs/usr/bin/tramys2
    1.14  	install -Dm644 -o root $stuff/tramys2.desktop \
    1.15  		$fs/usr/share/applications/tramys2.desktop
    1.16 +
    1.17 +	cd $stuff
    1.18 +	make msgfmt
    1.19 +	mkdir -p $fs/usr/share/locale
    1.20 +	cp $stuff/po/mo/* $fs/usr/share/locale
    1.21 +	make clean
    1.22  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tramys-client/stuff/Makefile	Thu Aug 28 04:01:02 2014 +0300
     2.3 @@ -0,0 +1,32 @@
     2.4 +# Makefile for tramys-client
     2.5 +#
     2.6 +LINGUAS?=ru
     2.7 +
     2.8 +pot:
     2.9 +	xgettext -o po/tramys.pot -L Shell -k_ --package-name=tramys ./tramys2
    2.10 +
    2.11 +msgmerge:
    2.12 +	@for l in $(LINGUAS); do \
    2.13 +		if [ -f "po/$$l.po" ]; then \
    2.14 +			echo -n "Updating $$l po file."; \
    2.15 +			msgmerge -U po/$$l.po po/tramys.pot ; \
    2.16 +		fi; \
    2.17 +	done
    2.18 +
    2.19 +msgfmt:
    2.20 +	@for l in $(LINGUAS); do \
    2.21 +		if [ -f "po/$$l.po" ]; then \
    2.22 +			echo -n "Compiling tramys $$l mo file... "; \
    2.23 +			mkdir -p po/mo/$$l/LC_MESSAGES; \
    2.24 +			msgfmt -o po/mo/$$l/LC_MESSAGES/tramys.mo po/$$l.po ; \
    2.25 +			echo "done"; \
    2.26 +		fi; \
    2.27 +	done;
    2.28 +
    2.29 +clean:
    2.30 +	rm -rf po/mo
    2.31 +	rm -f po/*~
    2.32 +	rm -f po/*.mo
    2.33 +
    2.34 +help:
    2.35 +	@echo "make [ pot | msgmerge | msgfmt | clean ]"
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tramys-client/stuff/po/ru.po	Thu Aug 28 04:01:02 2014 +0300
     3.3 @@ -0,0 +1,52 @@
     3.4 +# Russian translations for tramys package
     3.5 +# Copyright (C) 2014 SliTaz GNU/Linux
     3.6 +# This file is distributed under the same license as the tramys-client package.
     3.7 +# Aleksej Bobylev <al.bobylev@gmail.com>, 2014.
     3.8 +#
     3.9 +msgid ""
    3.10 +msgstr ""
    3.11 +"Project-Id-Version: tramys\n"
    3.12 +"Report-Msgid-Bugs-To: \n"
    3.13 +"POT-Creation-Date: 2014-08-28 02:14+0300\n"
    3.14 +"PO-Revision-Date: 2014-08-28 02:21+0300\n"
    3.15 +"Last-Translator: Aleksej Bobylev <al.bobylev@gmail.com>\n"
    3.16 +"Language-Team: Russian\n"
    3.17 +"Language: ru\n"
    3.18 +"MIME-Version: 1.0\n"
    3.19 +"Content-Type: text/plain; charset=UTF-8\n"
    3.20 +"Content-Transfer-Encoding: 8bit\n"
    3.21 +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
    3.22 +
    3.23 +#: tramys2:27
    3.24 +#, sh-format
    3.25 +msgid ""
    3.26 +"Now translations for all installed programs will be found and downloaded.\n"
    3.27 +"You can change locale if you want, or proceed.\n"
    3.28 +"\n"
    3.29 +"Your current locale: <b>$LANG</b>"
    3.30 +msgstr ""
    3.31 +"Сейчас будут найдены и загружены переводы для всех установленных программ.\n"
    3.32 +"При необходимости вы можете изменить локаль или продолжить.\n"
    3.33 +"\n"
    3.34 +"Текущая локаль: <b>$LANG</b>"
    3.35 +
    3.36 +#: tramys2:51
    3.37 +msgid ""
    3.38 +"The server processes the request.\n"
    3.39 +"Please wait."
    3.40 +msgstr ""
    3.41 +"Сервер обрабатывает запрос.\n"
    3.42 +"Пожалуйста, подождите."
    3.43 +
    3.44 +#: tramys2:75
    3.45 +msgid ""
    3.46 +"Downloading in progress.\n"
    3.47 +"Please wait."
    3.48 +msgstr ""
    3.49 +"Загрузка файла.\n"
    3.50 +"Пожалуйста, подождите."
    3.51 +
    3.52 +#: tramys2:125
    3.53 +msgid "Translation files have been installed in your system."
    3.54 +msgstr "Файлы переводов были установлены в вашу систему."
    3.55 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tramys-client/stuff/po/tramys.pot	Thu Aug 28 04:01:02 2014 +0300
     4.3 @@ -0,0 +1,43 @@
     4.4 +# SOME DESCRIPTIVE TITLE.
     4.5 +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
     4.6 +# This file is distributed under the same license as the PACKAGE package.
     4.7 +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     4.8 +#
     4.9 +#, fuzzy
    4.10 +msgid ""
    4.11 +msgstr ""
    4.12 +"Project-Id-Version: tramys\n"
    4.13 +"Report-Msgid-Bugs-To: \n"
    4.14 +"POT-Creation-Date: 2014-08-28 02:14+0300\n"
    4.15 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    4.16 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    4.17 +"Language-Team: LANGUAGE <LL@li.org>\n"
    4.18 +"Language: \n"
    4.19 +"MIME-Version: 1.0\n"
    4.20 +"Content-Type: text/plain; charset=CHARSET\n"
    4.21 +"Content-Transfer-Encoding: 8bit\n"
    4.22 +
    4.23 +#: tramys2:27
    4.24 +#, sh-format
    4.25 +msgid ""
    4.26 +"Now translations for all installed programs will be found and downloaded.\n"
    4.27 +"You can change locale if you want, or proceed.\n"
    4.28 +"\n"
    4.29 +"Your current locale: <b>$LANG</b>"
    4.30 +msgstr ""
    4.31 +
    4.32 +#: tramys2:51
    4.33 +msgid ""
    4.34 +"The server processes the request.\n"
    4.35 +"Please wait."
    4.36 +msgstr ""
    4.37 +
    4.38 +#: tramys2:75
    4.39 +msgid ""
    4.40 +"Downloading in progress.\n"
    4.41 +"Please wait."
    4.42 +msgstr ""
    4.43 +
    4.44 +#: tramys2:125
    4.45 +msgid "Translation files have been installed in your system."
    4.46 +msgstr ""
     5.1 --- a/tramys-client/stuff/tramys2	Thu Aug 28 01:42:21 2014 +0200
     5.2 +++ b/tramys-client/stuff/tramys2	Thu Aug 28 04:01:02 2014 +0300
     5.3 @@ -5,7 +5,6 @@
     5.4  
     5.5  . /etc/slitaz/slitaz.conf
     5.6  . /lib/libtaz.sh
     5.7 -. /etc/locale.conf
     5.8  
     5.9  # Ask for root access in order to install the files in the system.
    5.10  if [ $(id -u) != 0 ]; then
    5.11 @@ -31,7 +30,7 @@
    5.12  Your current locale: <b>$LANG</b>')" \
    5.13  	--button "gtk-edit:2" --button "gtk-cancel:1" --button "gtk-go-forward:0"
    5.14  case $? in
    5.15 -	2) tazbox locale; tramys2; exit 0 ;;
    5.16 +	2) tazbox locale; . /etc/locale.conf; tramys2; exit 0 ;;
    5.17  	1) exit 0 ;;
    5.18  esac
    5.19  
     6.1 --- a/tramys-server/receipt	Thu Aug 28 01:42:21 2014 +0200
     6.2 +++ b/tramys-server/receipt	Thu Aug 28 04:01:02 2014 +0300
     6.3 @@ -1,7 +1,7 @@
     6.4  # SliTaz package receipt.
     6.5  
     6.6  PACKAGE="tramys-server"
     6.7 -VERSION="140826"
     6.8 +VERSION="140828"
     6.9  CATEGORY="system-tools"
    6.10  SHORT_DESC="Tool for managing translation files for SliTaz GNU/Linux, server part"
    6.11  MAINTAINER="al.bobylev@gmail.com"
     7.1 --- a/tramys-server/stuff/tramys2.cgi	Thu Aug 28 01:42:21 2014 +0200
     7.2 +++ b/tramys-server/stuff/tramys2.cgi	Thu Aug 28 04:01:02 2014 +0300
     7.3 @@ -16,6 +16,7 @@
     7.4  #    HTTP_COOKIE (dl=DLKEY) -> send /tmp/tmp.DLKEY.tgz file
     7.5  
     7.6  . /usr/bin/httpd_helper.sh
     7.7 +. /home/slitaz/www/cook/tramys2.msg # translations
     7.8  
     7.9  WORKING=$(busybox mktemp -d) # make temp working dir /tmp/tmp.??????
    7.10  DATADIR=/usr/share/tramys    # this folder contains lists
    7.11 @@ -125,23 +126,18 @@
    7.12  		NUM=1 # initial value
    7.13  
    7.14  		echo -e "Content-Type: text/plain\n\n" # to Yad client
    7.15 -		echo "#Number of packages: $PKGNUM"    # Message to Yad log
    7.16 -		echo "#Searching in progress..."       # And another one
    7.17 +		msg 1 # Message to Yad log
    7.18  
    7.19  		copy_translations
    7.20  
    7.21 -		echo "#"                                  # Message to Yad log
    7.22 -		echo "#Preparing archive. Please wait..." # And another one
    7.23 +		msg 2 # Message to Yad log
    7.24  
    7.25  		# Make the archive from working dir and remove temp working dir.
    7.26  		busybox tar -czf $WORKING.tgz -C $WORKING .
    7.27  		rm -rf $WORKING
    7.28  
    7.29 -		echo "#" # to Yad client log
    7.30 -		echo "#Done!"
    7.31 -		echo "#Now you can proceed to downloading"
    7.32 -		echo "#and installing your translations."
    7.33 -		echo "#File size: $(stat -c %s $WORKING.tgz) bytes."
    7.34 +		SIZE=$(ls -lh $WORKING.tgz | awk '{print $5}')
    7.35 +		msg 3 # Message to Yad log
    7.36  
    7.37  		echo "${WORKING#*.}" # give download token to Yad client
    7.38  		exit 0 ;;
    7.39 @@ -151,7 +147,7 @@
    7.40  		archive="/tmp/tmp.$(echo $arg | tr -cd 'A-Za-z0-9').tgz"
    7.41  		rm -f $archive
    7.42  		cat <<EOT
    7.43 -Content-Type: text/plain
    7.44 +Content-Type: text/plain; charset=UTF-8
    7.45  Content-Length: 0
    7.46  
    7.47  EOT
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tramys-server/stuff/tramys2.msg	Thu Aug 28 04:01:02 2014 +0300
     8.3 @@ -0,0 +1,37 @@
     8.4 +# Sorry, no gettext here. It needs to install locale packages for used locales,
     8.5 +# and I don't want to install them to our Tank server.
     8.6 +
     8.7 +msg() {
     8.8 +case $lang in
     8.9 +	pt_BR)
    8.10 +		case $1 in
    8.11 +			1)  echo "#Pacotes instalados: $PKGNUM"
    8.12 +				echo "#Pesquisando em andamento..." ;;
    8.13 +			2)  echo -e "#\n#Fazendo um arquivo. Por favor, aguarde..." ;;
    8.14 +			3)  SIZE=$(echo $SIZE | sed -e 's|.*|&B|')
    8.15 +				echo -e "#\n#Feito!"
    8.16 +				echo -e "#Agora você pode continuar a fazer\n#download e instalar as suas traduções."
    8.17 +				echo "#O tamanho do arquivo: $SIZE" ;;
    8.18 +		esac ;;
    8.19 +	ru*)
    8.20 +		case $1 in
    8.21 +			1)  echo "#Количество пакетов: $PKGNUM"
    8.22 +				echo "#Поиск переводов…" ;;
    8.23 +			2)  echo -e "#\n#Создание архива. Подождите…" ;;
    8.24 +			3)  SIZE=$(echo $SIZE | sed -e 's|\.|,|;s|[0-9,]*|& |;s|.*|&Б|')
    8.25 +				echo -e "#\n#Готово!"
    8.26 +				echo -e "#Теперь вы можете загрузить\n#и установить найденные переводы."
    8.27 +				echo "#Размер файла: $SIZE" ;;
    8.28 +		esac ;;
    8.29 +	*)
    8.30 +		case $1 in
    8.31 +			1)  echo "#Number of packages: $PKGNUM"
    8.32 +				echo "#Searching in progress..." ;;
    8.33 +			2)  echo -e "#\n#Preparing archive. Please wait..." ;;
    8.34 +			3)  SIZE=$(echo $SIZE | sed -e 's|.*|&B|')
    8.35 +				echo -e "#\n#Done!"
    8.36 +				echo -e "#Now you can proceed to downloading\n#and installing your translations."
    8.37 +				echo "#File size: $SIZE" ;;
    8.38 +		esac ;;
    8.39 +esac
    8.40 +}